diff --git a/ts2panda/src/compiler.ts b/ts2panda/src/compiler.ts index 5ad1fc05044da80118a45a02defea09347913a4b..053bbdfc6c97cf0d500d9084a866e608de939db8 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 e3ba10ca90838821142f396a2929c62704838865..bed67ac32659e50a4cd268bcdc681043ec8d6327 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 {