Skip to content

Commit 9b84247

Browse files
committed
Update LKG
1 parent c5e6118 commit 9b84247

File tree

4 files changed

+48
-40
lines changed

4 files changed

+48
-40
lines changed

lib/tsc.js

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4768,6 +4768,15 @@ var ts;
47684768
return !!node && (node.kind === 162 || node.kind === 161);
47694769
}
47704770
ts.isBindingPattern = isBindingPattern;
4771+
function isNodeDescendentOf(node, ancestor) {
4772+
while (node) {
4773+
if (node === ancestor)
4774+
return true;
4775+
node = node.parent;
4776+
}
4777+
return false;
4778+
}
4779+
ts.isNodeDescendentOf = isNodeDescendentOf;
47714780
function isInAmbientContext(node) {
47724781
while (node) {
47734782
if (node.flags & (2 | 8192)) {
@@ -13966,7 +13975,8 @@ var ts;
1396613975
var container = ts.getThisContainer(node, false);
1396713976
var parent = container && container.parent;
1396813977
if (parent && (ts.isClassLike(parent) || parent.kind === 215)) {
13969-
if (!(container.flags & 128)) {
13978+
if (!(container.flags & 128) &&
13979+
(container.kind !== 144 || ts.isNodeDescendentOf(node, container.body))) {
1397013980
return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(parent)).thisType;
1397113981
}
1397213982
}
@@ -24351,16 +24361,8 @@ var ts;
2435124361
diagnostics: diagnostics,
2435224362
sourceMaps: sourceMapDataList
2435324363
};
24354-
function isNodeDescendentOf(node, ancestor) {
24355-
while (node) {
24356-
if (node === ancestor)
24357-
return true;
24358-
node = node.parent;
24359-
}
24360-
return false;
24361-
}
2436224364
function isUniqueLocalName(name, container) {
24363-
for (var node = container; isNodeDescendentOf(node, container); node = node.nextContainer) {
24365+
for (var node = container; ts.isNodeDescendentOf(node, container); node = node.nextContainer) {
2436424366
if (node.locals && ts.hasProperty(node.locals, name)) {
2436524367
if (node.locals[name].flags & (107455 | 1048576 | 8388608)) {
2436624368
return false;

lib/tsserver.js

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4501,6 +4501,15 @@ var ts;
45014501
return !!node && (node.kind === 162 || node.kind === 161);
45024502
}
45034503
ts.isBindingPattern = isBindingPattern;
4504+
function isNodeDescendentOf(node, ancestor) {
4505+
while (node) {
4506+
if (node === ancestor)
4507+
return true;
4508+
node = node.parent;
4509+
}
4510+
return false;
4511+
}
4512+
ts.isNodeDescendentOf = isNodeDescendentOf;
45044513
function isInAmbientContext(node) {
45054514
while (node) {
45064515
if (node.flags & (2 | 8192)) {
@@ -14429,7 +14438,8 @@ var ts;
1442914438
var container = ts.getThisContainer(node, false);
1443014439
var parent = container && container.parent;
1443114440
if (parent && (ts.isClassLike(parent) || parent.kind === 215)) {
14432-
if (!(container.flags & 128)) {
14441+
if (!(container.flags & 128) &&
14442+
(container.kind !== 144 || ts.isNodeDescendentOf(node, container.body))) {
1443314443
return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(parent)).thisType;
1443414444
}
1443514445
}
@@ -24814,16 +24824,8 @@ var ts;
2481424824
diagnostics: diagnostics,
2481524825
sourceMaps: sourceMapDataList
2481624826
};
24817-
function isNodeDescendentOf(node, ancestor) {
24818-
while (node) {
24819-
if (node === ancestor)
24820-
return true;
24821-
node = node.parent;
24822-
}
24823-
return false;
24824-
}
2482524827
function isUniqueLocalName(name, container) {
24826-
for (var node = container; isNodeDescendentOf(node, container); node = node.nextContainer) {
24828+
for (var node = container; ts.isNodeDescendentOf(node, container); node = node.nextContainer) {
2482724829
if (node.locals && ts.hasProperty(node.locals, name)) {
2482824830
if (node.locals[name].flags & (107455 | 1048576 | 8388608)) {
2482924831
return false;

lib/typescript.js

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6189,6 +6189,15 @@ var ts;
61896189
return !!node && (node.kind === 162 /* ArrayBindingPattern */ || node.kind === 161 /* ObjectBindingPattern */);
61906190
}
61916191
ts.isBindingPattern = isBindingPattern;
6192+
function isNodeDescendentOf(node, ancestor) {
6193+
while (node) {
6194+
if (node === ancestor)
6195+
return true;
6196+
node = node.parent;
6197+
}
6198+
return false;
6199+
}
6200+
ts.isNodeDescendentOf = isNodeDescendentOf;
61926201
function isInAmbientContext(node) {
61936202
while (node) {
61946203
if (node.flags & (2 /* Ambient */ | 8192 /* DeclarationFile */)) {
@@ -17284,7 +17293,8 @@ var ts;
1728417293
var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false);
1728517294
var parent = container && container.parent;
1728617295
if (parent && (ts.isClassLike(parent) || parent.kind === 215 /* InterfaceDeclaration */)) {
17287-
if (!(container.flags & 128 /* Static */)) {
17296+
if (!(container.flags & 128 /* Static */) &&
17297+
(container.kind !== 144 /* Constructor */ || ts.isNodeDescendentOf(node, container.body))) {
1728817298
return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(parent)).thisType;
1728917299
}
1729017300
}
@@ -29492,16 +29502,8 @@ var ts;
2949229502
diagnostics: diagnostics,
2949329503
sourceMaps: sourceMapDataList
2949429504
};
29495-
function isNodeDescendentOf(node, ancestor) {
29496-
while (node) {
29497-
if (node === ancestor)
29498-
return true;
29499-
node = node.parent;
29500-
}
29501-
return false;
29502-
}
2950329505
function isUniqueLocalName(name, container) {
29504-
for (var node = container; isNodeDescendentOf(node, container); node = node.nextContainer) {
29506+
for (var node = container; ts.isNodeDescendentOf(node, container); node = node.nextContainer) {
2950529507
if (node.locals && ts.hasProperty(node.locals, name)) {
2950629508
// We conservatively include alias symbols to cover cases where they're emitted as locals
2950729509
if (node.locals[name].flags & (107455 /* Value */ | 1048576 /* ExportValue */ | 8388608 /* Alias */)) {

lib/typescriptServices.js

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6189,6 +6189,15 @@ var ts;
61896189
return !!node && (node.kind === 162 /* ArrayBindingPattern */ || node.kind === 161 /* ObjectBindingPattern */);
61906190
}
61916191
ts.isBindingPattern = isBindingPattern;
6192+
function isNodeDescendentOf(node, ancestor) {
6193+
while (node) {
6194+
if (node === ancestor)
6195+
return true;
6196+
node = node.parent;
6197+
}
6198+
return false;
6199+
}
6200+
ts.isNodeDescendentOf = isNodeDescendentOf;
61926201
function isInAmbientContext(node) {
61936202
while (node) {
61946203
if (node.flags & (2 /* Ambient */ | 8192 /* DeclarationFile */)) {
@@ -17284,7 +17293,8 @@ var ts;
1728417293
var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false);
1728517294
var parent = container && container.parent;
1728617295
if (parent && (ts.isClassLike(parent) || parent.kind === 215 /* InterfaceDeclaration */)) {
17287-
if (!(container.flags & 128 /* Static */)) {
17296+
if (!(container.flags & 128 /* Static */) &&
17297+
(container.kind !== 144 /* Constructor */ || ts.isNodeDescendentOf(node, container.body))) {
1728817298
return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(parent)).thisType;
1728917299
}
1729017300
}
@@ -29492,16 +29502,8 @@ var ts;
2949229502
diagnostics: diagnostics,
2949329503
sourceMaps: sourceMapDataList
2949429504
};
29495-
function isNodeDescendentOf(node, ancestor) {
29496-
while (node) {
29497-
if (node === ancestor)
29498-
return true;
29499-
node = node.parent;
29500-
}
29501-
return false;
29502-
}
2950329505
function isUniqueLocalName(name, container) {
29504-
for (var node = container; isNodeDescendentOf(node, container); node = node.nextContainer) {
29506+
for (var node = container; ts.isNodeDescendentOf(node, container); node = node.nextContainer) {
2950529507
if (node.locals && ts.hasProperty(node.locals, name)) {
2950629508
// We conservatively include alias symbols to cover cases where they're emitted as locals
2950729509
if (node.locals[name].flags & (107455 /* Value */ | 1048576 /* ExportValue */ | 8388608 /* Alias */)) {

0 commit comments

Comments
 (0)