mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Use BindableStaticNameExpression not BindableStaticAccessExpression
This type does allow identifiers, but those are ruled out earlier, so I added an assert for that case.
This commit is contained in:
@@ -2983,10 +2983,7 @@ namespace ts {
|
||||
addLateBoundAssignmentDeclarationToSymbol(node, sym);
|
||||
}
|
||||
else {
|
||||
if (!isBindableStaticAccessExpression(node.left)) {
|
||||
return Debug.fail(`Invalid cast. The supplied value ${getTextOfNode(node.left)} was not a BindableStaticAccessExpression.`);
|
||||
}
|
||||
bindStaticPropertyAssignment(node.left as BindableStaticAccessExpression);
|
||||
bindStaticPropertyAssignment(cast(node.left, isBindableStaticNameExpression));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2994,7 +2991,8 @@ namespace ts {
|
||||
* For nodes like `x.y = z`, declare a member 'y' on 'x' if x is a function (or IIFE) or class or {}, or not declared.
|
||||
* Also works for expression statements preceded by JSDoc, like / ** @type number * / x.y;
|
||||
*/
|
||||
function bindStaticPropertyAssignment(node: BindableStaticAccessExpression) {
|
||||
function bindStaticPropertyAssignment(node: BindableStaticNameExpression) {
|
||||
Debug.assert(!isIdentifier(node));
|
||||
node.expression.parent = node;
|
||||
bindPropertyAssignment(node.expression, node, /*isPrototypeProperty*/ false, /*containerIsClass*/ false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user