Skip to content

Commit 599b9b0

Browse files
committed
Update LKG
1 parent 78e9fe2 commit 599b9b0

File tree

6 files changed

+30
-8
lines changed

6 files changed

+30
-8
lines changed

lib/tsc.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7235,7 +7235,8 @@ var ts;
72357235
}
72367236
function nextTokenIsClassOrFunctionOrAsync() {
72377237
nextToken();
7238-
return token === 73 || token === 87 || token === 118;
7238+
return token === 73 || token === 87 ||
7239+
(token === 118 && lookAhead(nextTokenIsFunctionKeywordOnSameLine));
72397240
}
72407241
function isListElement(parsingContext, inErrorRecovery) {
72417242
var node = currentNode(parsingContext);
@@ -24050,6 +24051,7 @@ var ts;
2405024051
var parameter = local_1.valueDeclaration;
2405124052
if (compilerOptions.noUnusedParameters &&
2405224053
!ts.isParameterPropertyDeclaration(parameter) &&
24054+
!parameterIsThisKeyword(parameter) &&
2405324055
!parameterNameStartsWithUnderscore(parameter)) {
2405424056
error(local_1.valueDeclaration.name, ts.Diagnostics._0_is_declared_but_never_used, local_1.name);
2405524057
}
@@ -24065,6 +24067,9 @@ var ts;
2406524067
}
2406624068
}
2406724069
}
24070+
function parameterIsThisKeyword(parameter) {
24071+
return parameter.name && parameter.name.originalKeywordKind === 97;
24072+
}
2406824073
function parameterNameStartsWithUnderscore(parameter) {
2406924074
return parameter.name && parameter.name.kind === 69 && parameter.name.text.charCodeAt(0) === 95;
2407024075
}

lib/tsserver.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8153,7 +8153,8 @@ var ts;
81538153
}
81548154
function nextTokenIsClassOrFunctionOrAsync() {
81558155
nextToken();
8156-
return token === 73 || token === 87 || token === 118;
8156+
return token === 73 || token === 87 ||
8157+
(token === 118 && lookAhead(nextTokenIsFunctionKeywordOnSameLine));
81578158
}
81588159
function isListElement(parsingContext, inErrorRecovery) {
81598160
var node = currentNode(parsingContext);
@@ -24968,6 +24969,7 @@ var ts;
2496824969
var parameter = local_1.valueDeclaration;
2496924970
if (compilerOptions.noUnusedParameters &&
2497024971
!ts.isParameterPropertyDeclaration(parameter) &&
24972+
!parameterIsThisKeyword(parameter) &&
2497124973
!parameterNameStartsWithUnderscore(parameter)) {
2497224974
error(local_1.valueDeclaration.name, ts.Diagnostics._0_is_declared_but_never_used, local_1.name);
2497324975
}
@@ -24983,6 +24985,9 @@ var ts;
2498324985
}
2498424986
}
2498524987
}
24988+
function parameterIsThisKeyword(parameter) {
24989+
return parameter.name && parameter.name.originalKeywordKind === 97;
24990+
}
2498624991
function parameterNameStartsWithUnderscore(parameter) {
2498724992
return parameter.name && parameter.name.kind === 69 && parameter.name.text.charCodeAt(0) === 95;
2498824993
}
@@ -50792,7 +50797,6 @@ var ts;
5079250797
if (isOpen === void 0) { isOpen = false; }
5079350798
this.host = host;
5079450799
this.fileName = fileName;
50795-
this.content = content;
5079650800
this.isOpen = isOpen;
5079750801
this.children = [];
5079850802
this.formatCodeOptions = ts.clone(CompilerService.getDefaultFormatCodeOptions(this.host));

lib/tsserverlibrary.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8388,7 +8388,6 @@ declare namespace ts.server {
83888388
class ScriptInfo {
83898389
private host;
83908390
fileName: string;
8391-
content: string;
83928391
isOpen: boolean;
83938392
svc: ScriptVersionCache;
83948393
children: ScriptInfo[];

lib/tsserverlibrary.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8153,7 +8153,8 @@ var ts;
81538153
}
81548154
function nextTokenIsClassOrFunctionOrAsync() {
81558155
nextToken();
8156-
return token === 73 || token === 87 || token === 118;
8156+
return token === 73 || token === 87 ||
8157+
(token === 118 && lookAhead(nextTokenIsFunctionKeywordOnSameLine));
81578158
}
81588159
function isListElement(parsingContext, inErrorRecovery) {
81598160
var node = currentNode(parsingContext);
@@ -24968,6 +24969,7 @@ var ts;
2496824969
var parameter = local_1.valueDeclaration;
2496924970
if (compilerOptions.noUnusedParameters &&
2497024971
!ts.isParameterPropertyDeclaration(parameter) &&
24972+
!parameterIsThisKeyword(parameter) &&
2497124973
!parameterNameStartsWithUnderscore(parameter)) {
2497224974
error(local_1.valueDeclaration.name, ts.Diagnostics._0_is_declared_but_never_used, local_1.name);
2497324975
}
@@ -24983,6 +24985,9 @@ var ts;
2498324985
}
2498424986
}
2498524987
}
24988+
function parameterIsThisKeyword(parameter) {
24989+
return parameter.name && parameter.name.originalKeywordKind === 97;
24990+
}
2498624991
function parameterNameStartsWithUnderscore(parameter) {
2498724992
return parameter.name && parameter.name.kind === 69 && parameter.name.text.charCodeAt(0) === 95;
2498824993
}
@@ -50792,7 +50797,6 @@ var ts;
5079250797
if (isOpen === void 0) { isOpen = false; }
5079350798
this.host = host;
5079450799
this.fileName = fileName;
50795-
this.content = content;
5079650800
this.isOpen = isOpen;
5079750801
this.children = [];
5079850802
this.formatCodeOptions = ts.clone(CompilerService.getDefaultFormatCodeOptions(this.host));

lib/typescript.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8988,7 +8988,8 @@ var ts;
89888988
}
89898989
function nextTokenIsClassOrFunctionOrAsync() {
89908990
nextToken();
8991-
return token === 73 /* ClassKeyword */ || token === 87 /* FunctionKeyword */ || token === 118 /* AsyncKeyword */;
8991+
return token === 73 /* ClassKeyword */ || token === 87 /* FunctionKeyword */ ||
8992+
(token === 118 /* AsyncKeyword */ && lookAhead(nextTokenIsFunctionKeywordOnSameLine));
89928993
}
89938994
// True if positioned at the start of a list element
89948995
function isListElement(parsingContext, inErrorRecovery) {
@@ -29340,6 +29341,7 @@ var ts;
2934029341
var parameter = local_1.valueDeclaration;
2934129342
if (compilerOptions.noUnusedParameters &&
2934229343
!ts.isParameterPropertyDeclaration(parameter) &&
29344+
!parameterIsThisKeyword(parameter) &&
2934329345
!parameterNameStartsWithUnderscore(parameter)) {
2934429346
error(local_1.valueDeclaration.name, ts.Diagnostics._0_is_declared_but_never_used, local_1.name);
2934529347
}
@@ -29355,6 +29357,9 @@ var ts;
2935529357
}
2935629358
}
2935729359
}
29360+
function parameterIsThisKeyword(parameter) {
29361+
return parameter.name && parameter.name.originalKeywordKind === 97 /* ThisKeyword */;
29362+
}
2935829363
function parameterNameStartsWithUnderscore(parameter) {
2935929364
return parameter.name && parameter.name.kind === 69 /* Identifier */ && parameter.name.text.charCodeAt(0) === 95 /* _ */;
2936029365
}

lib/typescriptServices.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8988,7 +8988,8 @@ var ts;
89888988
}
89898989
function nextTokenIsClassOrFunctionOrAsync() {
89908990
nextToken();
8991-
return token === 73 /* ClassKeyword */ || token === 87 /* FunctionKeyword */ || token === 118 /* AsyncKeyword */;
8991+
return token === 73 /* ClassKeyword */ || token === 87 /* FunctionKeyword */ ||
8992+
(token === 118 /* AsyncKeyword */ && lookAhead(nextTokenIsFunctionKeywordOnSameLine));
89928993
}
89938994
// True if positioned at the start of a list element
89948995
function isListElement(parsingContext, inErrorRecovery) {
@@ -29340,6 +29341,7 @@ var ts;
2934029341
var parameter = local_1.valueDeclaration;
2934129342
if (compilerOptions.noUnusedParameters &&
2934229343
!ts.isParameterPropertyDeclaration(parameter) &&
29344+
!parameterIsThisKeyword(parameter) &&
2934329345
!parameterNameStartsWithUnderscore(parameter)) {
2934429346
error(local_1.valueDeclaration.name, ts.Diagnostics._0_is_declared_but_never_used, local_1.name);
2934529347
}
@@ -29355,6 +29357,9 @@ var ts;
2935529357
}
2935629358
}
2935729359
}
29360+
function parameterIsThisKeyword(parameter) {
29361+
return parameter.name && parameter.name.originalKeywordKind === 97 /* ThisKeyword */;
29362+
}
2935829363
function parameterNameStartsWithUnderscore(parameter) {
2935929364
return parameter.name && parameter.name.kind === 69 /* Identifier */ && parameter.name.text.charCodeAt(0) === 95 /* _ */;
2936029365
}

0 commit comments

Comments
 (0)