Skip to content

Commit ebb0906

Browse files
committed
Use originalKeywordKind to detect this parameters
1 parent 2cc040c commit ebb0906

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/compiler/emitter.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4578,7 +4578,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
45784578
return;
45794579
}
45804580

4581-
const skipThisCount = node.parameters.length && (<Identifier>node.parameters[0].name).text === "this" ? 1 : 0;
4581+
const skipThisCount = node.parameters.length && (<Identifier>node.parameters[0].name).originalKeywordKind === SyntaxKind.ThisKeyword ? 1 : 0;
45824582
const restIndex = node.parameters.length - 1 - skipThisCount;
45834583
const tempName = createTempVariable(TempFlags._i).text;
45844584
writeLine();
@@ -4727,7 +4727,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
47274727
write("(");
47284728
if (node) {
47294729
const parameters = node.parameters;
4730-
const skipCount = node.parameters.length && (<Identifier>node.parameters[0].name).text === "this" ? 1 : 0;
4730+
const skipCount = node.parameters.length && (<Identifier>node.parameters[0].name).originalKeywordKind === SyntaxKind.ThisKeyword ? 1 : 0;
47314731
const omitCount = languageVersion < ScriptTarget.ES6 && hasDeclaredRestParameter(node) ? 1 : 0;
47324732
emitList(parameters, skipCount, parameters.length - omitCount - skipCount, /*multiLine*/ false, /*trailingComma*/ false);
47334733
}
@@ -6156,7 +6156,7 @@ const _super = (function (geti, seti) {
61566156

61576157
if (valueDeclaration) {
61586158
const parameters = valueDeclaration.parameters;
6159-
const skipThisCount = parameters.length && (<Identifier>parameters[0].name).text === "this" ? 1 : 0;
6159+
const skipThisCount = parameters.length && (<Identifier>parameters[0].name).originalKeywordKind === SyntaxKind.ThisKeyword ? 1 : 0;
61606160
const parameterCount = parameters.length;
61616161
if (parameterCount > skipThisCount) {
61626162
for (let i = skipThisCount; i < parameterCount; i++) {

0 commit comments

Comments
 (0)