mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-30 01:04:49 -05:00
Fix crash for private identifier in expando assignments (#37764)
* Fix crash for private identifier in expando assignments It does this by disallowing private identifiers from expando assignments entirely. I haven't thought of a scenario where they make sense, but I haven't thought about it exhaustively either. Fixes #37356 * Update baselines I think the new error is probably better. It's certainly different!
This commit is contained in:
committed by
GitHub
parent
d68295e74e
commit
7cf4b12d88
@@ -2155,7 +2155,7 @@ namespace ts {
|
||||
|
||||
/** Any series of property and element accesses. */
|
||||
export function isBindableStaticAccessExpression(node: Node, excludeThisKeyword?: boolean): node is BindableStaticAccessExpression {
|
||||
return isPropertyAccessExpression(node) && (!excludeThisKeyword && node.expression.kind === SyntaxKind.ThisKeyword || isBindableStaticNameExpression(node.expression, /*excludeThisKeyword*/ true))
|
||||
return isPropertyAccessExpression(node) && (!excludeThisKeyword && node.expression.kind === SyntaxKind.ThisKeyword || isIdentifier(node.name) && isBindableStaticNameExpression(node.expression, /*excludeThisKeyword*/ true))
|
||||
|| isBindableStaticElementAccessExpression(node, excludeThisKeyword);
|
||||
}
|
||||
|
||||
@@ -4432,7 +4432,7 @@ namespace ts {
|
||||
}
|
||||
|
||||
export function isPropertyAccessEntityNameExpression(node: Node): node is PropertyAccessEntityNameExpression {
|
||||
return isPropertyAccessExpression(node) && isEntityNameExpression(node.expression);
|
||||
return isPropertyAccessExpression(node) && isIdentifier(node.name) && isEntityNameExpression(node.expression);
|
||||
}
|
||||
|
||||
export function tryGetPropertyAccessOrIdentifierToString(expr: Expression): string | undefined {
|
||||
|
||||
Reference in New Issue
Block a user