diff --git a/ts2panda/src/compilerDriver.ts b/ts2panda/src/compilerDriver.ts index fc4f34063f119295d36cc1805dc2b375ccb042c3..b71d158a8c665444add555d0c3afe56b45b3d5c5 100644 --- a/ts2panda/src/compilerDriver.ts +++ b/ts2panda/src/compilerDriver.ts @@ -244,6 +244,7 @@ export class CompilerDriver { } compileUnitTest(node: ts.SourceFile, literalBufferArray?: Array): void { + CompilerDriver.isTsFile = CompilerDriver.isTypeScriptSourceFile(node); let recorder = this.compilePrologue(node, true); for (let i = 0; i < this.pendingCompilationUnits.length; i++) { diff --git a/ts2panda/src/debuginfo.ts b/ts2panda/src/debuginfo.ts index b5f5007684ab166a79b825d2a629f4cc56743211..89ee18c4cb4f83d5cf1d4515e1a6cf92c94ab65c 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 40cbc33f374074fa546881fd82027161e85e9185..5054cf37a87511d170e2e9a10598cef982865915 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 09453513358f00bfe48aafb8114eb32c63af9b8d..001d58cee1d6df92c0e81b27ee1b32d8036eebd9 100755 --- a/ts2panda/tests/expression/functionExpression.test.ts +++ b/ts2panda/tests/expression/functionExpression.test.ts @@ -30,7 +30,6 @@ import { EcmaEqdyn, EcmaGetresumemode, EcmaLdlexenvdyn, - EcmaLdfunction, EcmaResumegenerator, EcmaReturnundefined, EcmaSuspendgenerator, @@ -40,7 +39,6 @@ import { Label, LdaDyn, LdaiDyn, - ResultType, ReturnDyn, StaDyn, VReg @@ -61,8 +59,6 @@ describe("compileFunctionExpression", function () { let expected_func = [ new EcmaLdlexenvdyn(), new StaDyn(new VReg()), - new EcmaLdfunction(), - new StaDyn(new VReg()), new LdaDyn(new VReg()), new StaDyn(new VReg()), new EcmaCallarg0dyn(new VReg()), diff --git a/ts2panda/ts2abc/ts2abc.cpp b/ts2panda/ts2abc/ts2abc.cpp index 8fe784726267062682188c9a915e779914194706..8eecc72a3d78d4651267482517c2946c7c38e8d3 100644 --- a/ts2panda/ts2abc/ts2abc.cpp +++ b/ts2panda/ts2abc/ts2abc.cpp @@ -605,7 +605,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;