From 145b59048d27caf5b5b4ce20487804c8c14ac0d5 Mon Sep 17 00:00:00 2001 From: ctw-ian Date: Tue, 23 Aug 2022 22:51:25 +0800 Subject: [PATCH] Fix compile ts compilation using ts2abc Issue:I5NS9C Signed-off-by: ctw-ian Change-Id: I934ea196692ac5b554d8976793ce018fd7ac0e26 --- ts2panda/src/compiler.ts | 2 +- ts2panda/src/recorder.ts | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/ts2panda/src/compiler.ts b/ts2panda/src/compiler.ts index 5ad1fc0504..053bbdfc6c 100644 --- a/ts2panda/src/compiler.ts +++ b/ts2panda/src/compiler.ts @@ -938,7 +938,7 @@ export class Compiler { compileClassDeclaration(this, expr); break; case ts.SyntaxKind.PartiallyEmittedExpression: - this.compileExpression(findInnerExprOfParenthesis(expr)); + this.compileExpression((expr).expression); break; case ts.SyntaxKind.CommaListExpression: compileCommaListExpression(this, expr); diff --git a/ts2panda/src/recorder.ts b/ts2panda/src/recorder.ts index e3ba10ca90..bed67ac326 100644 --- a/ts2panda/src/recorder.ts +++ b/ts2panda/src/recorder.ts @@ -626,8 +626,7 @@ export class Recorder { this.collectHoistDecls(node, hoistScope, funcDecl); } else if (scope instanceof LocalScope) { hoistScope = scope.getNearestVariableScope(); - let expectHoistScope = this.getScopeOfNode(node.parent.parent); - if ((hoistScope == expectHoistScope) && (hoistScope instanceof FunctionScope)) { + if (hoistScope instanceof FunctionScope) { need2AddDecls = this.collectHoistDecls(node, hoistScope, funcDecl); } } else { -- Gitee