From 4bb4831bbdb1586cb0ce5fbcda7956bfb1fe1b12 Mon Sep 17 00:00:00 2001 From: zhangrengao Date: Fri, 22 Apr 2022 17:46:21 +0800 Subject: [PATCH] Revert "fix label of stepover" This reverts commit e805405b929b97018430a7edca7e32cb1ed46d69. Signed-off-by: zhangrengao Change-Id: Ibfa91a653ebe6c8111b190504be0acf0aa5a62b5 --- ts2panda/src/compiler.ts | 4 ++-- ts2panda/src/function/asyncFunctionBuilder.ts | 4 ++-- ts2panda/src/pandagen.ts | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ts2panda/src/compiler.ts b/ts2panda/src/compiler.ts index a3f75d60ec..9f7bc7fc8d 100644 --- a/ts2panda/src/compiler.ts +++ b/ts2panda/src/compiler.ts @@ -241,8 +241,8 @@ export class Compiler { let funcName = jshelpers.getTextOfIdentifierOrLiteral((rootNode).name); let v = functionScope.find(funcName); if (v.scope == functionScope) { - this.pandaGen.loadAccumulator(NodeKind.FirstNodeOfFunction, getVregisterCache(this.pandaGen, CacheList.FUNC)); - this.pandaGen.storeAccToLexEnv(NodeKind.FirstNodeOfFunction, v.scope, v.level, v.v, true); + this.pandaGen.loadAccumulator(rootNode, getVregisterCache(this.pandaGen, CacheList.FUNC)); + this.pandaGen.storeAccToLexEnv(rootNode, v.scope, v.level, v.v, true); } } } diff --git a/ts2panda/src/function/asyncFunctionBuilder.ts b/ts2panda/src/function/asyncFunctionBuilder.ts index b38543fa6c..5c29ae1f70 100644 --- a/ts2panda/src/function/asyncFunctionBuilder.ts +++ b/ts2panda/src/function/asyncFunctionBuilder.ts @@ -48,8 +48,8 @@ export class AsyncFunctionBuilder { prepare(node: ts.Node): void { let pandaGen = this.pandaGen; - pandaGen.asyncFunctionEnter(NodeKind.Invalid); - pandaGen.storeAccumulator(NodeKind.Invalid, this.asyncObj); + pandaGen.asyncFunctionEnter(node); + pandaGen.storeAccumulator(node, this.asyncObj); pandaGen.label(node, this.beginLabel); } diff --git a/ts2panda/src/pandagen.ts b/ts2panda/src/pandagen.ts index ad0237aa79..eae6caebd1 100644 --- a/ts2panda/src/pandagen.ts +++ b/ts2panda/src/pandagen.ts @@ -659,7 +659,7 @@ export class PandaGen { // @ts-ignore label(node: ts.Node, label: Label) { - this.add(NodeKind.Invalid, label); + this.add(NodeKind.FirstNodeOfFunction, label); } branch(node: ts.Node | NodeKind, target: Label) { @@ -993,7 +993,7 @@ export class PandaGen { this.add(node, new EcmaGetresumemode(genObj)); } - asyncFunctionEnter(node: ts.Node | NodeKind) { + asyncFunctionEnter(node: ts.Node) { this.add(node, new EcmaAsyncfunctionenter()); } -- Gitee