Skip to content

Commit 8b2fe13

Browse files
Update LKG.
1 parent 14d95ed commit 8b2fe13

File tree

5 files changed

+162
-107
lines changed

5 files changed

+162
-107
lines changed

lib/tsc.js

+30-21
Original file line numberDiff line numberDiff line change
@@ -15554,7 +15554,7 @@ var ts;
1555415554
}
1555515555
function parseLeftHandSideExpressionOrHigher() {
1555615556
var expression;
15557-
if (token() === 91) {
15557+
if (token() === 91 && lookAhead(nextTokenIsOpenParenOrLessThan)) {
1555815558
sourceFile.flags |= 524288;
1555915559
expression = parseTokenNode();
1556015560
}
@@ -18760,7 +18760,20 @@ var ts;
1876018760
ts.forEachChild(node, bind, bindEach);
1876118761
}
1876218762
function bindChildrenWorker(node) {
18763-
ts.forEach(node.jsDoc, bind);
18763+
if (node.jsDoc) {
18764+
if (ts.isInJavaScriptFile(node)) {
18765+
for (var _i = 0, _a = node.jsDoc; _i < _a.length; _i++) {
18766+
var j = _a[_i];
18767+
bind(j);
18768+
}
18769+
}
18770+
else {
18771+
for (var _b = 0, _c = node.jsDoc; _b < _c.length; _b++) {
18772+
var j = _c[_b];
18773+
setParentPointers(node, j);
18774+
}
18775+
}
18776+
}
1876418777
if (checkUnreachable(node)) {
1876518778
bindEachChild(node);
1876618779
return;
@@ -19805,7 +19818,8 @@ var ts;
1980519818
}
1980619819
node.parent = parent;
1980719820
var saveInStrictMode = inStrictMode;
19808-
bindJSDocTypedefTagIfAny(node);
19821+
if (ts.isInJavaScriptFile(node))
19822+
bindJSDocTypedefTagIfAny(node);
1980919823
bindWorker(node);
1981019824
if (node.kind > 142) {
1981119825
var saveParent = parent;
@@ -19865,7 +19879,7 @@ var ts;
1986519879
function bindWorker(node) {
1986619880
switch (node.kind) {
1986719881
case 71:
19868-
if (ts.isInJavaScriptFile(node) && node.isInJSDocNamespace) {
19882+
if (node.isInJSDocNamespace) {
1986919883
var parentNode = node.parent;
1987019884
while (parentNode && parentNode.kind !== 291) {
1987119885
parentNode = parentNode.parent;
@@ -19925,10 +19939,7 @@ var ts;
1992519939
case 158:
1992619940
return checkTypePredicate(node);
1992719941
case 145:
19928-
if (node.parent.kind !== 290 || ts.isInJavaScriptFile(node)) {
19929-
return declareSymbolAndAddToSymbolTable(node, 262144, 530920);
19930-
}
19931-
return;
19942+
return declareSymbolAndAddToSymbolTable(node, 262144, 530920);
1993219943
case 146:
1993319944
return bindParameter(node);
1993419945
case 226:
@@ -19999,10 +20010,7 @@ var ts;
1999920010
case 232:
2000020011
return bindEnumDeclaration(node);
2000120012
case 233:
20002-
if (node.parent.kind !== 291 || ts.isInJavaScriptFile(node)) {
20003-
return bindModuleDeclaration(node);
20004-
}
20005-
return undefined;
20013+
return bindModuleDeclaration(node);
2000620014
case 254:
2000720015
return bindJsxAttributes(node);
2000820016
case 253:
@@ -20029,13 +20037,6 @@ var ts;
2002920037
}
2003020038
case 234:
2003120039
return updateStrictModeStatementList(node.statements);
20032-
default:
20033-
if (ts.isInJavaScriptFile(node))
20034-
return bindJSDocWorker(node);
20035-
}
20036-
}
20037-
function bindJSDocWorker(node) {
20038-
switch (node.kind) {
2003920040
case 276:
2004020041
return bindPropertyWorker(node);
2004120042
case 292:
@@ -21021,6 +21022,10 @@ var ts;
2102121022
}
2102221023
}
2102321024
ts.getTransformFlagsSubtreeExclusions = getTransformFlagsSubtreeExclusions;
21025+
function setParentPointers(parent, child) {
21026+
child.parent = parent;
21027+
ts.forEachChild(child, function (childsChild) { return setParentPointers(child, childsChild); });
21028+
}
2102421029
})(ts || (ts = {}));
2102521030
var ts;
2102621031
(function (ts) {
@@ -22632,8 +22637,9 @@ var ts;
2263222637
error(errorLocation, ts.Diagnostics.Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor, ts.declarationNameToString(propertyName), typeof nameArg === "string" ? nameArg : ts.declarationNameToString(nameArg));
2263322638
return undefined;
2263422639
}
22635-
if (meaning & 2 ||
22636-
((meaning & 32 || meaning & 384) && (meaning & 107455) === 107455)) {
22640+
if (errorLocation &&
22641+
(meaning & 2 ||
22642+
((meaning & 32 || meaning & 384) && (meaning & 107455) === 107455))) {
2263722643
var exportOrLocalSymbol = getExportSymbolOfValueSymbolIfExported(result);
2263822644
if (exportOrLocalSymbol.flags & 2 || exportOrLocalSymbol.flags & 32 || exportOrLocalSymbol.flags & 384) {
2263922645
checkResolvedBlockScopedVariable(exportOrLocalSymbol, errorLocation);
@@ -55596,6 +55602,9 @@ var ts;
5559655602
if (!ts.arrayIsEqualTo(oldSourceFile.moduleAugmentations, newSourceFile.moduleAugmentations, moduleNameIsEqualTo)) {
5559755603
oldProgram.structureIsReused = 1;
5559855604
}
55605+
if ((oldSourceFile.flags & 524288) !== (newSourceFile.flags & 524288)) {
55606+
oldProgram.structureIsReused = 1;
55607+
}
5559955608
if (!ts.arrayIsEqualTo(oldSourceFile.typeReferenceDirectives, newSourceFile.typeReferenceDirectives, fileReferenceIsEqualTo)) {
5560055609
oldProgram.structureIsReused = 1;
5560155610
}

lib/tsserver.js

+30-21
Original file line numberDiff line numberDiff line change
@@ -17391,7 +17391,7 @@ var ts;
1739117391
}
1739217392
function parseLeftHandSideExpressionOrHigher() {
1739317393
var expression;
17394-
if (token() === 91) {
17394+
if (token() === 91 && lookAhead(nextTokenIsOpenParenOrLessThan)) {
1739517395
sourceFile.flags |= 524288;
1739617396
expression = parseTokenNode();
1739717397
}
@@ -20662,7 +20662,20 @@ var ts;
2066220662
ts.forEachChild(node, bind, bindEach);
2066320663
}
2066420664
function bindChildrenWorker(node) {
20665-
ts.forEach(node.jsDoc, bind);
20665+
if (node.jsDoc) {
20666+
if (ts.isInJavaScriptFile(node)) {
20667+
for (var _i = 0, _a = node.jsDoc; _i < _a.length; _i++) {
20668+
var j = _a[_i];
20669+
bind(j);
20670+
}
20671+
}
20672+
else {
20673+
for (var _b = 0, _c = node.jsDoc; _b < _c.length; _b++) {
20674+
var j = _c[_b];
20675+
setParentPointers(node, j);
20676+
}
20677+
}
20678+
}
2066620679
if (checkUnreachable(node)) {
2066720680
bindEachChild(node);
2066820681
return;
@@ -21712,7 +21725,8 @@ var ts;
2171221725
}
2171321726
node.parent = parent;
2171421727
var saveInStrictMode = inStrictMode;
21715-
bindJSDocTypedefTagIfAny(node);
21728+
if (ts.isInJavaScriptFile(node))
21729+
bindJSDocTypedefTagIfAny(node);
2171621730
bindWorker(node);
2171721731
if (node.kind > 142) {
2171821732
var saveParent = parent;
@@ -21772,7 +21786,7 @@ var ts;
2177221786
function bindWorker(node) {
2177321787
switch (node.kind) {
2177421788
case 71:
21775-
if (ts.isInJavaScriptFile(node) && node.isInJSDocNamespace) {
21789+
if (node.isInJSDocNamespace) {
2177621790
var parentNode = node.parent;
2177721791
while (parentNode && parentNode.kind !== 291) {
2177821792
parentNode = parentNode.parent;
@@ -21832,10 +21846,7 @@ var ts;
2183221846
case 158:
2183321847
return checkTypePredicate(node);
2183421848
case 145:
21835-
if (node.parent.kind !== 290 || ts.isInJavaScriptFile(node)) {
21836-
return declareSymbolAndAddToSymbolTable(node, 262144, 530920);
21837-
}
21838-
return;
21849+
return declareSymbolAndAddToSymbolTable(node, 262144, 530920);
2183921850
case 146:
2184021851
return bindParameter(node);
2184121852
case 226:
@@ -21906,10 +21917,7 @@ var ts;
2190621917
case 232:
2190721918
return bindEnumDeclaration(node);
2190821919
case 233:
21909-
if (node.parent.kind !== 291 || ts.isInJavaScriptFile(node)) {
21910-
return bindModuleDeclaration(node);
21911-
}
21912-
return undefined;
21920+
return bindModuleDeclaration(node);
2191321921
case 254:
2191421922
return bindJsxAttributes(node);
2191521923
case 253:
@@ -21936,13 +21944,6 @@ var ts;
2193621944
}
2193721945
case 234:
2193821946
return updateStrictModeStatementList(node.statements);
21939-
default:
21940-
if (ts.isInJavaScriptFile(node))
21941-
return bindJSDocWorker(node);
21942-
}
21943-
}
21944-
function bindJSDocWorker(node) {
21945-
switch (node.kind) {
2194621947
case 276:
2194721948
return bindPropertyWorker(node);
2194821949
case 292:
@@ -22928,6 +22929,10 @@ var ts;
2292822929
}
2292922930
}
2293022931
ts.getTransformFlagsSubtreeExclusions = getTransformFlagsSubtreeExclusions;
22932+
function setParentPointers(parent, child) {
22933+
child.parent = parent;
22934+
ts.forEachChild(child, function (childsChild) { return setParentPointers(child, childsChild); });
22935+
}
2293122936
})(ts || (ts = {}));
2293222937
var ts;
2293322938
(function (ts) {
@@ -23826,8 +23831,9 @@ var ts;
2382623831
error(errorLocation, ts.Diagnostics.Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor, ts.declarationNameToString(propertyName), typeof nameArg === "string" ? nameArg : ts.declarationNameToString(nameArg));
2382723832
return undefined;
2382823833
}
23829-
if (meaning & 2 ||
23830-
((meaning & 32 || meaning & 384) && (meaning & 107455) === 107455)) {
23834+
if (errorLocation &&
23835+
(meaning & 2 ||
23836+
((meaning & 32 || meaning & 384) && (meaning & 107455) === 107455))) {
2383123837
var exportOrLocalSymbol = getExportSymbolOfValueSymbolIfExported(result);
2383223838
if (exportOrLocalSymbol.flags & 2 || exportOrLocalSymbol.flags & 32 || exportOrLocalSymbol.flags & 384) {
2383323839
checkResolvedBlockScopedVariable(exportOrLocalSymbol, errorLocation);
@@ -57028,6 +57034,9 @@ var ts;
5702857034
if (!ts.arrayIsEqualTo(oldSourceFile.moduleAugmentations, newSourceFile.moduleAugmentations, moduleNameIsEqualTo)) {
5702957035
oldProgram.structureIsReused = 1;
5703057036
}
57037+
if ((oldSourceFile.flags & 524288) !== (newSourceFile.flags & 524288)) {
57038+
oldProgram.structureIsReused = 1;
57039+
}
5703157040
if (!ts.arrayIsEqualTo(oldSourceFile.typeReferenceDirectives, newSourceFile.typeReferenceDirectives, fileReferenceIsEqualTo)) {
5703257041
oldProgram.structureIsReused = 1;
5703357042
}

lib/tsserverlibrary.js

+30-21
Original file line numberDiff line numberDiff line change
@@ -18788,7 +18788,7 @@ var ts;
1878818788
}
1878918789
function parseLeftHandSideExpressionOrHigher() {
1879018790
var expression;
18791-
if (token() === 91) {
18791+
if (token() === 91 && lookAhead(nextTokenIsOpenParenOrLessThan)) {
1879218792
sourceFile.flags |= 524288;
1879318793
expression = parseTokenNode();
1879418794
}
@@ -22059,7 +22059,20 @@ var ts;
2205922059
ts.forEachChild(node, bind, bindEach);
2206022060
}
2206122061
function bindChildrenWorker(node) {
22062-
ts.forEach(node.jsDoc, bind);
22062+
if (node.jsDoc) {
22063+
if (ts.isInJavaScriptFile(node)) {
22064+
for (var _i = 0, _a = node.jsDoc; _i < _a.length; _i++) {
22065+
var j = _a[_i];
22066+
bind(j);
22067+
}
22068+
}
22069+
else {
22070+
for (var _b = 0, _c = node.jsDoc; _b < _c.length; _b++) {
22071+
var j = _c[_b];
22072+
setParentPointers(node, j);
22073+
}
22074+
}
22075+
}
2206322076
if (checkUnreachable(node)) {
2206422077
bindEachChild(node);
2206522078
return;
@@ -23109,7 +23122,8 @@ var ts;
2310923122
}
2311023123
node.parent = parent;
2311123124
var saveInStrictMode = inStrictMode;
23112-
bindJSDocTypedefTagIfAny(node);
23125+
if (ts.isInJavaScriptFile(node))
23126+
bindJSDocTypedefTagIfAny(node);
2311323127
bindWorker(node);
2311423128
if (node.kind > 142) {
2311523129
var saveParent = parent;
@@ -23169,7 +23183,7 @@ var ts;
2316923183
function bindWorker(node) {
2317023184
switch (node.kind) {
2317123185
case 71:
23172-
if (ts.isInJavaScriptFile(node) && node.isInJSDocNamespace) {
23186+
if (node.isInJSDocNamespace) {
2317323187
var parentNode = node.parent;
2317423188
while (parentNode && parentNode.kind !== 291) {
2317523189
parentNode = parentNode.parent;
@@ -23229,10 +23243,7 @@ var ts;
2322923243
case 158:
2323023244
return checkTypePredicate(node);
2323123245
case 145:
23232-
if (node.parent.kind !== 290 || ts.isInJavaScriptFile(node)) {
23233-
return declareSymbolAndAddToSymbolTable(node, 262144, 530920);
23234-
}
23235-
return;
23246+
return declareSymbolAndAddToSymbolTable(node, 262144, 530920);
2323623247
case 146:
2323723248
return bindParameter(node);
2323823249
case 226:
@@ -23303,10 +23314,7 @@ var ts;
2330323314
case 232:
2330423315
return bindEnumDeclaration(node);
2330523316
case 233:
23306-
if (node.parent.kind !== 291 || ts.isInJavaScriptFile(node)) {
23307-
return bindModuleDeclaration(node);
23308-
}
23309-
return undefined;
23317+
return bindModuleDeclaration(node);
2331023318
case 254:
2331123319
return bindJsxAttributes(node);
2331223320
case 253:
@@ -23333,13 +23341,6 @@ var ts;
2333323341
}
2333423342
case 234:
2333523343
return updateStrictModeStatementList(node.statements);
23336-
default:
23337-
if (ts.isInJavaScriptFile(node))
23338-
return bindJSDocWorker(node);
23339-
}
23340-
}
23341-
function bindJSDocWorker(node) {
23342-
switch (node.kind) {
2334323344
case 276:
2334423345
return bindPropertyWorker(node);
2334523346
case 292:
@@ -24325,6 +24326,10 @@ var ts;
2432524326
}
2432624327
}
2432724328
ts.getTransformFlagsSubtreeExclusions = getTransformFlagsSubtreeExclusions;
24329+
function setParentPointers(parent, child) {
24330+
child.parent = parent;
24331+
ts.forEachChild(child, function (childsChild) { return setParentPointers(child, childsChild); });
24332+
}
2432824333
})(ts || (ts = {}));
2432924334
var ts;
2433024335
(function (ts) {
@@ -25223,8 +25228,9 @@ var ts;
2522325228
error(errorLocation, ts.Diagnostics.Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor, ts.declarationNameToString(propertyName), typeof nameArg === "string" ? nameArg : ts.declarationNameToString(nameArg));
2522425229
return undefined;
2522525230
}
25226-
if (meaning & 2 ||
25227-
((meaning & 32 || meaning & 384) && (meaning & 107455) === 107455)) {
25231+
if (errorLocation &&
25232+
(meaning & 2 ||
25233+
((meaning & 32 || meaning & 384) && (meaning & 107455) === 107455))) {
2522825234
var exportOrLocalSymbol = getExportSymbolOfValueSymbolIfExported(result);
2522925235
if (exportOrLocalSymbol.flags & 2 || exportOrLocalSymbol.flags & 32 || exportOrLocalSymbol.flags & 384) {
2523025236
checkResolvedBlockScopedVariable(exportOrLocalSymbol, errorLocation);
@@ -58425,6 +58431,9 @@ var ts;
5842558431
if (!ts.arrayIsEqualTo(oldSourceFile.moduleAugmentations, newSourceFile.moduleAugmentations, moduleNameIsEqualTo)) {
5842658432
oldProgram.structureIsReused = 1;
5842758433
}
58434+
if ((oldSourceFile.flags & 524288) !== (newSourceFile.flags & 524288)) {
58435+
oldProgram.structureIsReused = 1;
58436+
}
5842858437
if (!ts.arrayIsEqualTo(oldSourceFile.typeReferenceDirectives, newSourceFile.typeReferenceDirectives, fileReferenceIsEqualTo)) {
5842958438
oldProgram.structureIsReused = 1;
5843058439
}

0 commit comments

Comments
 (0)