diff --git a/arkui-plugins/interop-plugins/index.ts b/arkui-plugins/interop-plugins/index.ts index dc69677c950a3dfd7cb75baca0361a07692407b1..94f3d2d01b0145555385cce5e516a6b129748512 100644 --- a/arkui-plugins/interop-plugins/index.ts +++ b/arkui-plugins/interop-plugins/index.ts @@ -28,9 +28,7 @@ export function interopTransform():Plugins { name: 'interop-plugin', parsed: parsedTransform, checked: checkedTransform, - clean(): void { - arkts.arktsGlobal.clearContext(); - }, + clean(): void {}, }; } @@ -89,7 +87,7 @@ function checkedTransform(this: PluginContext): arkts.EtsScript | undefined { program = programVisitor.programVisitor(program); script = program.astNode; arkts.recheckSubtree(script); - this.setArkTSAst(script); + this.setArkTSAst(script); debugLog('interopTransform:checked exit'); return script; } diff --git a/arkui-plugins/memo-plugins/index.ts b/arkui-plugins/memo-plugins/index.ts index ca4c52e15885416980842f37b2454707e96ea1de..407e83623265d04381abfdd52a4c9306c53ca53f 100644 --- a/arkui-plugins/memo-plugins/index.ts +++ b/arkui-plugins/memo-plugins/index.ts @@ -32,7 +32,6 @@ export function unmemoizeTransform(): Plugins { checked: checkedTransform, clean() { ProgramSkipper.clear(); - arkts.arktsGlobal.clearContext(); }, }; } @@ -52,7 +51,7 @@ function checkedTransform(this: PluginContext): arkts.EtsScript | undefined { program = checkedProgramVisit(program, this, canSkipPhases, isFrameworkMode); script = program.astNode; arkts.Performance.getInstance().stopEvent('memo-checked', true); - + arkts.Performance.getInstance().memoryTrackerGetDelta('UIPlugin:Memo-AfterCheck'); arkts.Performance.getInstance().memoryTrackerReset(); diff --git a/arkui-plugins/ui-plugins/index.ts b/arkui-plugins/ui-plugins/index.ts index f34b9b1e8fff8aaeeb9cd546ebd4ae32068b2e6c..80310401ba30a964a13c484757fb691b226941a0 100644 --- a/arkui-plugins/ui-plugins/index.ts +++ b/arkui-plugins/ui-plugins/index.ts @@ -30,7 +30,6 @@ export function uiTransform(): Plugins { checked: checkedTransform, clean() { ProgramSkipper.clear(); - arkts.arktsGlobal.clearContext(); }, }; } diff --git a/koala-wrapper/src/arkts-api/utilities/public.ts b/koala-wrapper/src/arkts-api/utilities/public.ts index b7e5706196b31a9e5c0fc00c8dfb2a3f2595f542..87cd9b8404855859545ebf9649599c0ddb029a32 100644 --- a/koala-wrapper/src/arkts-api/utilities/public.ts +++ b/koala-wrapper/src/arkts-api/utilities/public.ts @@ -60,21 +60,16 @@ export function proceedToState(state: Es2pandaContextState, context: KNativePoin } function processErrorState(state: Es2pandaContextState, context: KNativePointer, forceDtsEmit = false): void { - try { - if (global.es2panda._ContextState(context) === Es2pandaContextState.ES2PANDA_STATE_ERROR && !forceDtsEmit) { - const errorMessage = withStringResult(global.es2panda._ContextErrorMessage(context)); - if (errorMessage === undefined) { - throwError(`Could not get ContextErrorMessage`); - } - const allErrorMessages = withStringResult(global.es2panda._GetAllErrorMessages(context)); - if (allErrorMessages === undefined) { - throwError(`Could not get AllErrorMessages`); - } - throwError([`Failed to proceed to ${Es2pandaContextState[state]}`, errorMessage, allErrorMessages].join(`\n`)); + if (global.es2panda._ContextState(context) === Es2pandaContextState.ES2PANDA_STATE_ERROR && !forceDtsEmit) { + const errorMessage = withStringResult(global.es2panda._ContextErrorMessage(context)); + if (errorMessage === undefined) { + throwError(`Could not get ContextErrorMessage`); } - } catch (e) { - global.es2panda._DestroyContext(context); - throw e; + const allErrorMessages = withStringResult(global.es2panda._GetAllErrorMessages(context)); + if (allErrorMessages === undefined) { + throwError(`Could not get AllErrorMessages`); + } + throwError([`Failed to proceed to ${Es2pandaContextState[state]}`, errorMessage, allErrorMessages].join(`\n`)); } } diff --git a/koala-wrapper/src/es2panda.ts b/koala-wrapper/src/es2panda.ts index 9e0e14f4e7f78e6c544bf042bbb384da38f88710..7a05dea345a82146099ed17ce378d5219d84d956 100644 --- a/koala-wrapper/src/es2panda.ts +++ b/koala-wrapper/src/es2panda.ts @@ -13,12 +13,7 @@ * limitations under the License. */ -import * as fs from "node:fs" -import * as path from "node:path" import { global } from "./arkts-api/static/global" -import { isNumber, throwError, withWarning, filterSource } from "./utils" -import { Es2pandaContextState } from "./generated/Es2pandaEnums" -import { AstNode, Config, Context, EtsScript, proceedToState } from "./arkts-api" import * as arkts from "./arkts-api" export {arkts, global as arktsGlobal}