Skip to content

Commit 7b7febd

Browse files
committed
Update LKG
1 parent d8468f7 commit 7b7febd

File tree

2 files changed

+40
-16
lines changed

2 files changed

+40
-16
lines changed

bin/tsc.js

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4560,16 +4560,16 @@ var ts;
45604560
}
45614561
function parsePrimaryExpression() {
45624562
switch (token) {
4563+
case 6 /* NumericLiteral */:
4564+
case 7 /* StringLiteral */:
4565+
case 9 /* NoSubstitutionTemplateLiteral */:
4566+
return parseLiteralNode();
45634567
case 91 /* ThisKeyword */:
45644568
case 89 /* SuperKeyword */:
45654569
case 87 /* NullKeyword */:
45664570
case 93 /* TrueKeyword */:
45674571
case 78 /* FalseKeyword */:
45684572
return parseTokenNode();
4569-
case 6 /* NumericLiteral */:
4570-
case 7 /* StringLiteral */:
4571-
case 9 /* NoSubstitutionTemplateLiteral */:
4572-
return parseLiteralNode();
45734573
case 15 /* OpenParenToken */:
45744574
return parseParenthesizedExpression();
45754575
case 17 /* OpenBracketToken */:
@@ -6592,7 +6592,10 @@ var ts;
65926592
}
65936593
}
65946594
else {
6595-
if (!(findSourceFile(filename + ".ts", isDefaultLib, refFile, refPos, refEnd) || findSourceFile(filename + ".d.ts", isDefaultLib, refFile, refPos, refEnd))) {
6595+
if (options.allowNonTsExtensions && !findSourceFile(filename, isDefaultLib, refFile, refPos, refEnd)) {
6596+
diagnostic = ts.Diagnostics.File_0_not_found;
6597+
}
6598+
else if (!findSourceFile(filename + ".ts", isDefaultLib, refFile, refPos, refEnd) && !findSourceFile(filename + ".d.ts", isDefaultLib, refFile, refPos, refEnd)) {
65966599
diagnostic = ts.Diagnostics.File_0_not_found;
65976600
filename += ".ts";
65986601
}
@@ -11583,7 +11586,6 @@ var ts;
1158311586
case 131 /* IndexSignature */:
1158411587
case 123 /* Parameter */:
1158511588
case 190 /* ModuleBlock */:
11586-
case 122 /* TypeParameter */:
1158711589
case 133 /* FunctionType */:
1158811590
case 134 /* ConstructorType */:
1158911591
case 136 /* TypeLiteral */:
@@ -11593,6 +11595,7 @@ var ts;
1159311595
case 139 /* UnionType */:
1159411596
case 140 /* ParenthesizedType */:
1159511597
return isDeclarationVisible(node.parent);
11598+
case 122 /* TypeParameter */:
1159611599
case 201 /* SourceFile */:
1159711600
return true;
1159811601
default:
@@ -17569,8 +17572,17 @@ var ts;
1756917572
}
1757017573
function isUniqueLocalName(name, container) {
1757117574
for (var node = container; isNodeDescendentOf(node, container); node = node.nextContainer) {
17572-
if (node.locals && ts.hasProperty(node.locals, name) && node.locals[name].flags & (107455 /* Value */ | 4194304 /* ExportValue */)) {
17573-
return false;
17575+
if (node.locals && ts.hasProperty(node.locals, name)) {
17576+
var symbolWithRelevantName = node.locals[name];
17577+
if (symbolWithRelevantName.flags & (107455 /* Value */ | 4194304 /* ExportValue */)) {
17578+
return false;
17579+
}
17580+
if (symbolWithRelevantName.flags & 33554432 /* Import */) {
17581+
var importDeclarationWithRelevantName = ts.getDeclarationOfKind(symbolWithRelevantName, 191 /* ImportDeclaration */);
17582+
if (isReferencedImportDeclaration(importDeclarationWithRelevantName)) {
17583+
return false;
17584+
}
17585+
}
1757417586
}
1757517587
}
1757617588
return true;

bin/typescriptServices.js

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5142,16 +5142,16 @@ var ts;
51425142
}
51435143
function parsePrimaryExpression() {
51445144
switch (token) {
5145+
case 6 /* NumericLiteral */:
5146+
case 7 /* StringLiteral */:
5147+
case 9 /* NoSubstitutionTemplateLiteral */:
5148+
return parseLiteralNode();
51455149
case 91 /* ThisKeyword */:
51465150
case 89 /* SuperKeyword */:
51475151
case 87 /* NullKeyword */:
51485152
case 93 /* TrueKeyword */:
51495153
case 78 /* FalseKeyword */:
51505154
return parseTokenNode();
5151-
case 6 /* NumericLiteral */:
5152-
case 7 /* StringLiteral */:
5153-
case 9 /* NoSubstitutionTemplateLiteral */:
5154-
return parseLiteralNode();
51555155
case 15 /* OpenParenToken */:
51565156
return parseParenthesizedExpression();
51575157
case 17 /* OpenBracketToken */:
@@ -7174,7 +7174,10 @@ var ts;
71747174
}
71757175
}
71767176
else {
7177-
if (!(findSourceFile(filename + ".ts", isDefaultLib, refFile, refPos, refEnd) || findSourceFile(filename + ".d.ts", isDefaultLib, refFile, refPos, refEnd))) {
7177+
if (options.allowNonTsExtensions && !findSourceFile(filename, isDefaultLib, refFile, refPos, refEnd)) {
7178+
diagnostic = ts.Diagnostics.File_0_not_found;
7179+
}
7180+
else if (!findSourceFile(filename + ".ts", isDefaultLib, refFile, refPos, refEnd) && !findSourceFile(filename + ".d.ts", isDefaultLib, refFile, refPos, refEnd)) {
71787181
diagnostic = ts.Diagnostics.File_0_not_found;
71797182
filename += ".ts";
71807183
}
@@ -12171,7 +12174,6 @@ var ts;
1217112174
case 131 /* IndexSignature */:
1217212175
case 123 /* Parameter */:
1217312176
case 190 /* ModuleBlock */:
12174-
case 122 /* TypeParameter */:
1217512177
case 133 /* FunctionType */:
1217612178
case 134 /* ConstructorType */:
1217712179
case 136 /* TypeLiteral */:
@@ -12181,6 +12183,7 @@ var ts;
1218112183
case 139 /* UnionType */:
1218212184
case 140 /* ParenthesizedType */:
1218312185
return isDeclarationVisible(node.parent);
12186+
case 122 /* TypeParameter */:
1218412187
case 201 /* SourceFile */:
1218512188
return true;
1218612189
default:
@@ -18157,8 +18160,17 @@ var ts;
1815718160
}
1815818161
function isUniqueLocalName(name, container) {
1815918162
for (var node = container; isNodeDescendentOf(node, container); node = node.nextContainer) {
18160-
if (node.locals && ts.hasProperty(node.locals, name) && node.locals[name].flags & (107455 /* Value */ | 4194304 /* ExportValue */)) {
18161-
return false;
18163+
if (node.locals && ts.hasProperty(node.locals, name)) {
18164+
var symbolWithRelevantName = node.locals[name];
18165+
if (symbolWithRelevantName.flags & (107455 /* Value */ | 4194304 /* ExportValue */)) {
18166+
return false;
18167+
}
18168+
if (symbolWithRelevantName.flags & 33554432 /* Import */) {
18169+
var importDeclarationWithRelevantName = ts.getDeclarationOfKind(symbolWithRelevantName, 191 /* ImportDeclaration */);
18170+
if (isReferencedImportDeclaration(importDeclarationWithRelevantName)) {
18171+
return false;
18172+
}
18173+
}
1816218174
}
1816318175
}
1816418176
return true;

0 commit comments

Comments
 (0)