diff --git a/ts2panda/src/addVariable2Scope.ts b/ts2panda/src/addVariable2Scope.ts index 0f64f618bd98e704a544007959ff3287c266fc62..f9c7c3935d5cfc12e500066735ec8f027057da16 100644 --- a/ts2panda/src/addVariable2Scope.ts +++ b/ts2panda/src/addVariable2Scope.ts @@ -72,7 +72,7 @@ function addInnerArgs(node: ts.Node, scope: VariableScope, enableTypeRecord: boo scope.addParameter(MandatoryFuncObj, VarDeclarationKind.CONST, -1); // the second argument for newTarget - if (node.kind == ts.SyntaxKind.ArrowFunction) { + if (node.kind === ts.SyntaxKind.ArrowFunction) { scope.addParameter("0newTarget", VarDeclarationKind.CONST, -1); scope.addParameter("0this", VarDeclarationKind.CONST, 0); } else { diff --git a/ts2panda/src/assemblyDumper.ts b/ts2panda/src/assemblyDumper.ts index 6b2fc9d7932499c3f87709cea21d47a4de824f3f..933d4941320570ab6ebedd175b23406cfca1a414 100644 --- a/ts2panda/src/assemblyDumper.ts +++ b/ts2panda/src/assemblyDumper.ts @@ -102,25 +102,25 @@ export class AssemblyDumper { let formats = node.getFormats(); var outputRangeVregNum = getRangeExplicitVregNums(node); for (let j = 0; j < operands.length; ++j) { - if (outputRangeVregNum == 0) { + if (outputRangeVregNum === 0) { break; } let format = formats[0]; let kind = format[j][0]; let op = operands[j]; - if (kind == OperandKind.Imm) { + if (kind === OperandKind.Imm) { let imm = op; this.output += imm.value.toString(); - } else if (kind == OperandKind.Id) { + } else if (kind === OperandKind.Id) { this.output += op; - } else if (kind == OperandKind.StringId) { + } else if (kind === OperandKind.StringId) { let escapedOp = op.toString().replace(/\\/g, "\\\\").replace(/\t/g, "\\t") .replace(/\n/g, "\\n").replace(/\"/g, "\\\"") this.output += "\"" + escapedOp + "\""; - } else if (kind == OperandKind.DstVReg - || kind == OperandKind.SrcDstVReg - || kind == OperandKind.SrcVReg) { + } else if (kind === OperandKind.DstVReg + || kind === OperandKind.SrcDstVReg + || kind === OperandKind.SrcVReg) { let v = op; if (v.num < 0) { throw Error("invalid register, please check your insn!\n"); @@ -131,7 +131,7 @@ export class AssemblyDumper { outputRangeVregNum--; continue; } - } else if (kind == OperandKind.Label) { + } else if (kind === OperandKind.Label) { this.output += this.getLabelName(