fix funcnode of global

Signed-off-by: zhangrengao <zhangrengao1@huawei.com>
Change-Id: Ie794d7ee49f5ac6d5c421f827f811d9a81237c54
This commit is contained in:
zhangrengao
2022-05-24 17:38:47 +08:00
parent 061c0d11db
commit 849bf9a7e8
+1 -1
View File
@@ -138,7 +138,7 @@ export function addVariableToScope(recorder: Recorder, enableTypeRecord: boolean
let funcNode = decl.node;
if (ts.isFunctionDeclaration(funcNode)) {
v = scope.add(decl, VarDeclarationKind.FUNCTION);
} else {
} else if (ts.isFunctionExpression(funcNode)) {
let functionScope = <Scope>recorder.getScopeOfNode(funcNode);
v = functionScope.add(decl, VarDeclarationKind.FUNCTION);
}