Skip to content

Commit 49dfb5f

Browse files
typescript-botDanielRosenwasser
authored andcommitted
Update LKG
1 parent 7afaef1 commit 49dfb5f

File tree

6 files changed

+97
-65
lines changed

6 files changed

+97
-65
lines changed

lib/tsc.js

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8773,13 +8773,6 @@ var ts;
87738773
isBindableStaticNameExpression(expr.arguments[0], true);
87748774
}
87758775
ts.isBindableObjectDefinePropertyCall = isBindableObjectDefinePropertyCall;
8776-
function isBindableStaticElementAccessExpression(node, excludeThisKeyword) {
8777-
return isLiteralLikeElementAccess(node)
8778-
&& ((!excludeThisKeyword && node.expression.kind === 103) ||
8779-
isEntityNameExpression(node.expression) ||
8780-
isBindableStaticElementAccessExpression(node.expression, true));
8781-
}
8782-
ts.isBindableStaticElementAccessExpression = isBindableStaticElementAccessExpression;
87838776
function isLiteralLikeAccess(node) {
87848777
return ts.isPropertyAccessExpression(node) || isLiteralLikeElementAccess(node);
87858778
}
@@ -8794,6 +8787,13 @@ var ts;
87948787
|| isBindableStaticElementAccessExpression(node, excludeThisKeyword);
87958788
}
87968789
ts.isBindableStaticAccessExpression = isBindableStaticAccessExpression;
8790+
function isBindableStaticElementAccessExpression(node, excludeThisKeyword) {
8791+
return isLiteralLikeElementAccess(node)
8792+
&& ((!excludeThisKeyword && node.expression.kind === 103) ||
8793+
isEntityNameExpression(node.expression) ||
8794+
isBindableStaticAccessExpression(node.expression, true));
8795+
}
8796+
ts.isBindableStaticElementAccessExpression = isBindableStaticElementAccessExpression;
87978797
function isBindableStaticNameExpression(node, excludeThisKeyword) {
87988798
return isEntityNameExpression(node) || isBindableStaticAccessExpression(node, excludeThisKeyword);
87998799
}
@@ -8822,7 +8822,7 @@ var ts;
88228822
if (expr.operatorToken.kind !== 62 || !isAccessExpression(expr.left)) {
88238823
return 0;
88248824
}
8825-
if (isBindableStaticNameExpression(expr.left.expression) && getElementOrPropertyAccessName(expr.left) === "prototype" && ts.isObjectLiteralExpression(getInitializerOfBinaryExpression(expr))) {
8825+
if (isBindableStaticNameExpression(expr.left.expression, true) && getElementOrPropertyAccessName(expr.left) === "prototype" && ts.isObjectLiteralExpression(getInitializerOfBinaryExpression(expr))) {
88268826
return 6;
88278827
}
88288828
return getAssignmentDeclarationPropertyAccessKind(expr.left);
@@ -8875,7 +8875,9 @@ var ts;
88758875
isBindableStaticAccessExpression(lhs)) {
88768876
return 1;
88778877
}
8878-
return 5;
8878+
if (isBindableStaticNameExpression(lhs, true) || (ts.isElementAccessExpression(lhs) && isDynamicName(lhs) && lhs.expression.kind !== 103)) {
8879+
return 5;
8880+
}
88798881
}
88808882
return 0;
88818883
}
@@ -25553,7 +25555,7 @@ var ts;
2555325555
constructorSymbol = lookupSymbolForPropertyAccess(l.expression.expression, thisParentContainer);
2555425556
}
2555525557
}
25556-
if (constructorSymbol) {
25558+
if (constructorSymbol && constructorSymbol.valueDeclaration) {
2555725559
constructorSymbol.members = constructorSymbol.members || ts.createSymbolTable();
2555825560
if (ts.hasDynamicName(node)) {
2555925561
bindDynamicallyNamedThisPropertyAssignment(node, constructorSymbol);

lib/tsserver.js

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11566,27 +11566,31 @@ var ts;
1156611566
isBindableStaticNameExpression(expr.arguments[0], /*excludeThisKeyword*/ true);
1156711567
}
1156811568
ts.isBindableObjectDefinePropertyCall = isBindableObjectDefinePropertyCall;
11569-
function isBindableStaticElementAccessExpression(node, excludeThisKeyword) {
11570-
return isLiteralLikeElementAccess(node)
11571-
&& ((!excludeThisKeyword && node.expression.kind === 103 /* ThisKeyword */) ||
11572-
isEntityNameExpression(node.expression) ||
11573-
isBindableStaticElementAccessExpression(node.expression, /*excludeThisKeyword*/ true));
11574-
}
11575-
ts.isBindableStaticElementAccessExpression = isBindableStaticElementAccessExpression;
11569+
/** x.y OR x[0] */
1157611570
function isLiteralLikeAccess(node) {
1157711571
return ts.isPropertyAccessExpression(node) || isLiteralLikeElementAccess(node);
1157811572
}
1157911573
ts.isLiteralLikeAccess = isLiteralLikeAccess;
11574+
/** x[0] OR x['a'] OR x[Symbol.y] */
1158011575
function isLiteralLikeElementAccess(node) {
1158111576
return ts.isElementAccessExpression(node) && (isStringOrNumericLiteralLike(node.argumentExpression) ||
1158211577
isWellKnownSymbolSyntactically(node.argumentExpression));
1158311578
}
1158411579
ts.isLiteralLikeElementAccess = isLiteralLikeElementAccess;
11580+
/** Any series of property and element accesses. */
1158511581
function isBindableStaticAccessExpression(node, excludeThisKeyword) {
1158611582
return ts.isPropertyAccessExpression(node) && (!excludeThisKeyword && node.expression.kind === 103 /* ThisKeyword */ || isBindableStaticNameExpression(node.expression, /*excludeThisKeyword*/ true))
1158711583
|| isBindableStaticElementAccessExpression(node, excludeThisKeyword);
1158811584
}
1158911585
ts.isBindableStaticAccessExpression = isBindableStaticAccessExpression;
11586+
/** Any series of property and element accesses, ending in a literal element access */
11587+
function isBindableStaticElementAccessExpression(node, excludeThisKeyword) {
11588+
return isLiteralLikeElementAccess(node)
11589+
&& ((!excludeThisKeyword && node.expression.kind === 103 /* ThisKeyword */) ||
11590+
isEntityNameExpression(node.expression) ||
11591+
isBindableStaticAccessExpression(node.expression, /*excludeThisKeyword*/ true));
11592+
}
11593+
ts.isBindableStaticElementAccessExpression = isBindableStaticElementAccessExpression;
1159011594
function isBindableStaticNameExpression(node, excludeThisKeyword) {
1159111595
return isEntityNameExpression(node) || isBindableStaticAccessExpression(node, excludeThisKeyword);
1159211596
}
@@ -11615,7 +11619,7 @@ var ts;
1161511619
if (expr.operatorToken.kind !== 62 /* EqualsToken */ || !isAccessExpression(expr.left)) {
1161611620
return 0 /* None */;
1161711621
}
11618-
if (isBindableStaticNameExpression(expr.left.expression) && getElementOrPropertyAccessName(expr.left) === "prototype" && ts.isObjectLiteralExpression(getInitializerOfBinaryExpression(expr))) {
11622+
if (isBindableStaticNameExpression(expr.left.expression, /*excludeThisKeyword*/ true) && getElementOrPropertyAccessName(expr.left) === "prototype" && ts.isObjectLiteralExpression(getInitializerOfBinaryExpression(expr))) {
1161911623
// F.prototype = { ... }
1162011624
return 6 /* Prototype */;
1162111625
}
@@ -11678,8 +11682,10 @@ var ts;
1167811682
// exports.name = expr OR module.exports.name = expr OR exports["name"] = expr ...
1167911683
return 1 /* ExportsProperty */;
1168011684
}
11681-
// F.G...x = expr
11682-
return 5 /* Property */;
11685+
if (isBindableStaticNameExpression(lhs, /*excludeThisKeyword*/ true) || (ts.isElementAccessExpression(lhs) && isDynamicName(lhs) && lhs.expression.kind !== 103 /* ThisKeyword */)) {
11686+
// F.G...x = expr
11687+
return 5 /* Property */;
11688+
}
1168311689
}
1168411690
return 0 /* None */;
1168511691
}
@@ -31294,7 +31300,7 @@ var ts;
3129431300
constructorSymbol = lookupSymbolForPropertyAccess(l.expression.expression, thisParentContainer);
3129531301
}
3129631302
}
31297-
if (constructorSymbol) {
31303+
if (constructorSymbol && constructorSymbol.valueDeclaration) {
3129831304
// Declare a 'member' if the container is an ES5 class or ES6 constructor
3129931305
constructorSymbol.members = constructorSymbol.members || ts.createSymbolTable();
3130031306
// It's acceptable for multiple 'this' assignments of the same identifier to occur

lib/tsserverlibrary.js

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11716,27 +11716,31 @@ var ts;
1171611716
isBindableStaticNameExpression(expr.arguments[0], /*excludeThisKeyword*/ true);
1171711717
}
1171811718
ts.isBindableObjectDefinePropertyCall = isBindableObjectDefinePropertyCall;
11719-
function isBindableStaticElementAccessExpression(node, excludeThisKeyword) {
11720-
return isLiteralLikeElementAccess(node)
11721-
&& ((!excludeThisKeyword && node.expression.kind === 103 /* ThisKeyword */) ||
11722-
isEntityNameExpression(node.expression) ||
11723-
isBindableStaticElementAccessExpression(node.expression, /*excludeThisKeyword*/ true));
11724-
}
11725-
ts.isBindableStaticElementAccessExpression = isBindableStaticElementAccessExpression;
11719+
/** x.y OR x[0] */
1172611720
function isLiteralLikeAccess(node) {
1172711721
return ts.isPropertyAccessExpression(node) || isLiteralLikeElementAccess(node);
1172811722
}
1172911723
ts.isLiteralLikeAccess = isLiteralLikeAccess;
11724+
/** x[0] OR x['a'] OR x[Symbol.y] */
1173011725
function isLiteralLikeElementAccess(node) {
1173111726
return ts.isElementAccessExpression(node) && (isStringOrNumericLiteralLike(node.argumentExpression) ||
1173211727
isWellKnownSymbolSyntactically(node.argumentExpression));
1173311728
}
1173411729
ts.isLiteralLikeElementAccess = isLiteralLikeElementAccess;
11730+
/** Any series of property and element accesses. */
1173511731
function isBindableStaticAccessExpression(node, excludeThisKeyword) {
1173611732
return ts.isPropertyAccessExpression(node) && (!excludeThisKeyword && node.expression.kind === 103 /* ThisKeyword */ || isBindableStaticNameExpression(node.expression, /*excludeThisKeyword*/ true))
1173711733
|| isBindableStaticElementAccessExpression(node, excludeThisKeyword);
1173811734
}
1173911735
ts.isBindableStaticAccessExpression = isBindableStaticAccessExpression;
11736+
/** Any series of property and element accesses, ending in a literal element access */
11737+
function isBindableStaticElementAccessExpression(node, excludeThisKeyword) {
11738+
return isLiteralLikeElementAccess(node)
11739+
&& ((!excludeThisKeyword && node.expression.kind === 103 /* ThisKeyword */) ||
11740+
isEntityNameExpression(node.expression) ||
11741+
isBindableStaticAccessExpression(node.expression, /*excludeThisKeyword*/ true));
11742+
}
11743+
ts.isBindableStaticElementAccessExpression = isBindableStaticElementAccessExpression;
1174011744
function isBindableStaticNameExpression(node, excludeThisKeyword) {
1174111745
return isEntityNameExpression(node) || isBindableStaticAccessExpression(node, excludeThisKeyword);
1174211746
}
@@ -11765,7 +11769,7 @@ var ts;
1176511769
if (expr.operatorToken.kind !== 62 /* EqualsToken */ || !isAccessExpression(expr.left)) {
1176611770
return 0 /* None */;
1176711771
}
11768-
if (isBindableStaticNameExpression(expr.left.expression) && getElementOrPropertyAccessName(expr.left) === "prototype" && ts.isObjectLiteralExpression(getInitializerOfBinaryExpression(expr))) {
11772+
if (isBindableStaticNameExpression(expr.left.expression, /*excludeThisKeyword*/ true) && getElementOrPropertyAccessName(expr.left) === "prototype" && ts.isObjectLiteralExpression(getInitializerOfBinaryExpression(expr))) {
1176911773
// F.prototype = { ... }
1177011774
return 6 /* Prototype */;
1177111775
}
@@ -11828,8 +11832,10 @@ var ts;
1182811832
// exports.name = expr OR module.exports.name = expr OR exports["name"] = expr ...
1182911833
return 1 /* ExportsProperty */;
1183011834
}
11831-
// F.G...x = expr
11832-
return 5 /* Property */;
11835+
if (isBindableStaticNameExpression(lhs, /*excludeThisKeyword*/ true) || (ts.isElementAccessExpression(lhs) && isDynamicName(lhs) && lhs.expression.kind !== 103 /* ThisKeyword */)) {
11836+
// F.G...x = expr
11837+
return 5 /* Property */;
11838+
}
1183311839
}
1183411840
return 0 /* None */;
1183511841
}
@@ -31444,7 +31450,7 @@ var ts;
3144431450
constructorSymbol = lookupSymbolForPropertyAccess(l.expression.expression, thisParentContainer);
3144531451
}
3144631452
}
31447-
if (constructorSymbol) {
31453+
if (constructorSymbol && constructorSymbol.valueDeclaration) {
3144831454
// Declare a 'member' if the container is an ES5 class or ES6 constructor
3144931455
constructorSymbol.members = constructorSymbol.members || ts.createSymbolTable();
3145031456
// It's acceptable for multiple 'this' assignments of the same identifier to occur

lib/typescript.js

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11705,27 +11705,31 @@ var ts;
1170511705
isBindableStaticNameExpression(expr.arguments[0], /*excludeThisKeyword*/ true);
1170611706
}
1170711707
ts.isBindableObjectDefinePropertyCall = isBindableObjectDefinePropertyCall;
11708-
function isBindableStaticElementAccessExpression(node, excludeThisKeyword) {
11709-
return isLiteralLikeElementAccess(node)
11710-
&& ((!excludeThisKeyword && node.expression.kind === 103 /* ThisKeyword */) ||
11711-
isEntityNameExpression(node.expression) ||
11712-
isBindableStaticElementAccessExpression(node.expression, /*excludeThisKeyword*/ true));
11713-
}
11714-
ts.isBindableStaticElementAccessExpression = isBindableStaticElementAccessExpression;
11708+
/** x.y OR x[0] */
1171511709
function isLiteralLikeAccess(node) {
1171611710
return ts.isPropertyAccessExpression(node) || isLiteralLikeElementAccess(node);
1171711711
}
1171811712
ts.isLiteralLikeAccess = isLiteralLikeAccess;
11713+
/** x[0] OR x['a'] OR x[Symbol.y] */
1171911714
function isLiteralLikeElementAccess(node) {
1172011715
return ts.isElementAccessExpression(node) && (isStringOrNumericLiteralLike(node.argumentExpression) ||
1172111716
isWellKnownSymbolSyntactically(node.argumentExpression));
1172211717
}
1172311718
ts.isLiteralLikeElementAccess = isLiteralLikeElementAccess;
11719+
/** Any series of property and element accesses. */
1172411720
function isBindableStaticAccessExpression(node, excludeThisKeyword) {
1172511721
return ts.isPropertyAccessExpression(node) && (!excludeThisKeyword && node.expression.kind === 103 /* ThisKeyword */ || isBindableStaticNameExpression(node.expression, /*excludeThisKeyword*/ true))
1172611722
|| isBindableStaticElementAccessExpression(node, excludeThisKeyword);
1172711723
}
1172811724
ts.isBindableStaticAccessExpression = isBindableStaticAccessExpression;
11725+
/** Any series of property and element accesses, ending in a literal element access */
11726+
function isBindableStaticElementAccessExpression(node, excludeThisKeyword) {
11727+
return isLiteralLikeElementAccess(node)
11728+
&& ((!excludeThisKeyword && node.expression.kind === 103 /* ThisKeyword */) ||
11729+
isEntityNameExpression(node.expression) ||
11730+
isBindableStaticAccessExpression(node.expression, /*excludeThisKeyword*/ true));
11731+
}
11732+
ts.isBindableStaticElementAccessExpression = isBindableStaticElementAccessExpression;
1172911733
function isBindableStaticNameExpression(node, excludeThisKeyword) {
1173011734
return isEntityNameExpression(node) || isBindableStaticAccessExpression(node, excludeThisKeyword);
1173111735
}
@@ -11754,7 +11758,7 @@ var ts;
1175411758
if (expr.operatorToken.kind !== 62 /* EqualsToken */ || !isAccessExpression(expr.left)) {
1175511759
return 0 /* None */;
1175611760
}
11757-
if (isBindableStaticNameExpression(expr.left.expression) && getElementOrPropertyAccessName(expr.left) === "prototype" && ts.isObjectLiteralExpression(getInitializerOfBinaryExpression(expr))) {
11761+
if (isBindableStaticNameExpression(expr.left.expression, /*excludeThisKeyword*/ true) && getElementOrPropertyAccessName(expr.left) === "prototype" && ts.isObjectLiteralExpression(getInitializerOfBinaryExpression(expr))) {
1175811762
// F.prototype = { ... }
1175911763
return 6 /* Prototype */;
1176011764
}
@@ -11817,8 +11821,10 @@ var ts;
1181711821
// exports.name = expr OR module.exports.name = expr OR exports["name"] = expr ...
1181811822
return 1 /* ExportsProperty */;
1181911823
}
11820-
// F.G...x = expr
11821-
return 5 /* Property */;
11824+
if (isBindableStaticNameExpression(lhs, /*excludeThisKeyword*/ true) || (ts.isElementAccessExpression(lhs) && isDynamicName(lhs) && lhs.expression.kind !== 103 /* ThisKeyword */)) {
11825+
// F.G...x = expr
11826+
return 5 /* Property */;
11827+
}
1182211828
}
1182311829
return 0 /* None */;
1182411830
}
@@ -31433,7 +31439,7 @@ var ts;
3143331439
constructorSymbol = lookupSymbolForPropertyAccess(l.expression.expression, thisParentContainer);
3143431440
}
3143531441
}
31436-
if (constructorSymbol) {
31442+
if (constructorSymbol && constructorSymbol.valueDeclaration) {
3143731443
// Declare a 'member' if the container is an ES5 class or ES6 constructor
3143831444
constructorSymbol.members = constructorSymbol.members || ts.createSymbolTable();
3143931445
// It's acceptable for multiple 'this' assignments of the same identifier to occur

0 commit comments

Comments
 (0)