diff --git a/ts2panda/src/compiler.ts b/ts2panda/src/compiler.ts index e5c7df34ddb2fadde908714996776c225fa014c8..7b77359e95f5ffa689c0b49f43dbd50173113f99 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(NodeKind.Invalid, getVregisterCache(this.pandaGen, CacheList.FUNC)); + this.pandaGen.storeAccToLexEnv(NodeKind.Invalid, v.scope, v.level, v.v, true); } } } diff --git a/ts2panda/src/debuginfo.ts b/ts2panda/src/debuginfo.ts index 776cf9f6c95c8dbfe0a639d5935a24ca2db64c68..f002c920a104d17094fe93dd1ad5ecbf8c04d312 100644 --- a/ts2panda/src/debuginfo.ts +++ b/ts2panda/src/debuginfo.ts @@ -193,6 +193,11 @@ export class DebugInfo { } } + public static setInvalidPosInfoForUninitializeIns(posInfo: DebugPosInfo, pandaGen: PandaGen) { + posInfo.setSourecLineNum(-1); + posInfo.setSourecColumnNum(-1); + } + public static addScope(scope: Scope) { DebugInfo.scopeArray.push(scope); } @@ -277,7 +282,7 @@ export class DebugInfo { // count pos offset for (let i = 0; i < insns.length; i++) { if (insns[i].debugPosInfo.getDebugPosInfoNodeState() == NodeKind.FirstNodeOfFunction) { - DebugInfo.setPosInfoForUninitializeIns(insns[i].debugPosInfo, pandaGen); + DebugInfo.setInvalidPosInfoForUninitializeIns(insns[i].debugPosInfo, pandaGen); } let insLength = DebugInfo.getIRNodeWholeLength(insns[i]);