diff --git a/ts2panda/src/compilerDriver.ts b/ts2panda/src/compilerDriver.ts index 2613de96dfd061ac35085ba55443931435b46030..6d0ae1e58b74bb4e42092afdfbddbacc713cb842 100644 --- a/ts2panda/src/compilerDriver.ts +++ b/ts2panda/src/compilerDriver.ts @@ -247,6 +247,7 @@ export class CompilerDriver { } compileUnitTest(node: ts.SourceFile, literalBufferArray?: Array): void { + CompilerDriver.isTsFile = CompilerDriver.isTypeScriptSourceFile(node); let recorder = this.compilePrologue(node, true, true); for (let i = 0; i < this.pendingCompilationUnits.length; i++) { diff --git a/ts2panda/src/debuginfo.ts b/ts2panda/src/debuginfo.ts index 776cf9f6c95c8dbfe0a639d5935a24ca2db64c68..0eff7e3c0da6f98bc3e757ac978f0af03d6a1297 100644 --- a/ts2panda/src/debuginfo.ts +++ b/ts2panda/src/debuginfo.ts @@ -354,7 +354,6 @@ export class DebugInfo { } } - public static copyDebugInfo(insn: IRNode, expansion: IRNode[]) { expansion.forEach(irNode => irNode.debugPosInfo = insn.debugPosInfo); } diff --git a/ts2panda/templates/irnodes.ts.erb b/ts2panda/templates/irnodes.ts.erb index 3877645d32efee63421544ee70d509e0c39d54e6..8494ea5569e86eaf2d7daf269eedd8b6004df5c4 100755 --- a/ts2panda/templates/irnodes.ts.erb +++ b/ts2panda/templates/irnodes.ts.erb @@ -345,6 +345,8 @@ export abstract class Intrinsic extends IRNode { } export class VReg { + private typeIndex: number | undefined; + private variableName: string | undefined; num: number = -1; toString(): string { @@ -355,19 +357,19 @@ export class VReg { } getTypeIndex() { - return 0; + return this.typeIndex; } - // @ts-ignore setTypeIndex(typeIndex: number) { + this.typeIndex = typeIndex; } getVariableName() { - return ''; + return this.variableName; } - // @ts-ignore setVariableName(variableName: string) { + this.variableName = variableName; } } diff --git a/ts2panda/tests/expression/functionExpression.test.ts b/ts2panda/tests/expression/functionExpression.test.ts index bb7c46d53b165207cf03b4128904d89a72fd33bd..ef1c5f1a874184db23e18605ce3004621b1089c8 100755 --- a/ts2panda/tests/expression/functionExpression.test.ts +++ b/ts2panda/tests/expression/functionExpression.test.ts @@ -40,7 +40,6 @@ import { Label, LdaDyn, LdaiDyn, - ResultType, ReturnDyn, StaDyn, VReg @@ -65,6 +64,8 @@ describe("compileFunctionExpression", function () { new StaDyn(new VReg()), new LdaDyn(new VReg()), new StaDyn(new VReg()), + new LdaDyn(new VReg()), + new StaDyn(new VReg()), new EcmaCallarg0dyn(new VReg()), new EcmaReturnundefined() ]; diff --git a/ts2panda/ts2abc/ts2abc.cpp b/ts2panda/ts2abc/ts2abc.cpp index 631685c6098af2601b85c27a669cff021b49fa45..4ea87055b11f683acf5d40479b40156c211cd5b8 100644 --- a/ts2panda/ts2abc/ts2abc.cpp +++ b/ts2panda/ts2abc/ts2abc.cpp @@ -607,7 +607,7 @@ static void ParseFunctionCallType(const Json::Value &function, panda::pandasm::F funcName = function["n"].asString(); } if (funcName == "func_main_0") { - return ; + return; } uint32_t callType = 0;