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 8ae69bf05ba09ffc6a09d0b864406baeb1476a4d..14eeb2deb4582aa1bebcfb02be1164747907b341 100644 --- a/arkui-plugins/memo-plugins/index.ts +++ b/arkui-plugins/memo-plugins/index.ts @@ -29,9 +29,7 @@ export function unmemoizeTransform(): Plugins { return { name: 'memo-plugin', checked: checkedTransform, - clean() { - arkts.arktsGlobal.clearContext(); - }, + clean() {}, }; } diff --git a/arkui-plugins/ui-plugins/index.ts b/arkui-plugins/ui-plugins/index.ts index c89dd6eff217958eabd44595a2ff42893c4b9b1d..eeb1404808b2cadd0870f0e743ed25d2fd00ca6d 100644 --- a/arkui-plugins/ui-plugins/index.ts +++ b/arkui-plugins/ui-plugins/index.ts @@ -26,9 +26,7 @@ export function uiTransform(): Plugins { name: 'ui-plugin', parsed: parsedTransform, checked: checkedTransform, - clean() { - arkts.arktsGlobal.clearContext(); - }, + clean() {}, }; } diff --git a/koala-wrapper/src/arkts-api/utilities/public.ts b/koala-wrapper/src/arkts-api/utilities/public.ts index 834f12cce3dc8ab1262f1048b32aba1174df159f..43a7d8accfcdb6ed5997f3fca8cec652673ddcef 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}