mirror of
https://github.com/openharmony/ark_ts2abc.git
synced 2026-07-21 00:05:28 -04:00
fix UT
Signed-off-by: hufeng <hufeng20@huawei.com> Change-Id: I3c946719d490ee3e520391c967e2123bb1e2d6e7
This commit is contained in:
@@ -244,6 +244,7 @@ export class CompilerDriver {
|
||||
}
|
||||
|
||||
compileUnitTest(node: ts.SourceFile, literalBufferArray?: Array<LiteralBuffer>): void {
|
||||
CompilerDriver.isTsFile = CompilerDriver.isTypeScriptSourceFile(node);
|
||||
let recorder = this.compilePrologue(node, true);
|
||||
|
||||
for (let i = 0; i < this.pendingCompilationUnits.length; i++) {
|
||||
|
||||
@@ -354,7 +354,6 @@ export class DebugInfo {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static copyDebugInfo(insn: IRNode, expansion: IRNode[]) {
|
||||
expansion.forEach(irNode => irNode.debugPosInfo = insn.debugPosInfo);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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()),
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user