@@ -2061,26 +2061,30 @@ namespace ts {
2061
2061
isBindableStaticNameExpression ( expr . arguments [ 0 ] , /*excludeThisKeyword*/ true ) ;
2062
2062
}
2063
2063
2064
- export function isBindableStaticElementAccessExpression ( node : Node , excludeThisKeyword ?: boolean ) : node is BindableStaticElementAccessExpression {
2065
- return isLiteralLikeElementAccess ( node )
2066
- && ( ( ! excludeThisKeyword && node . expression . kind === SyntaxKind . ThisKeyword ) ||
2067
- isEntityNameExpression ( node . expression ) ||
2068
- isBindableStaticElementAccessExpression ( node . expression , /*excludeThisKeyword*/ true ) ) ;
2069
- }
2070
-
2064
+ /** x.y OR x[0] */
2071
2065
export function isLiteralLikeAccess ( node : Node ) : node is LiteralLikeElementAccessExpression | PropertyAccessExpression {
2072
2066
return isPropertyAccessExpression ( node ) || isLiteralLikeElementAccess ( node ) ;
2073
2067
}
2074
2068
2069
+ /** x[0] OR x['a'] OR x[Symbol.y] */
2075
2070
export function isLiteralLikeElementAccess ( node : Node ) : node is LiteralLikeElementAccessExpression {
2076
2071
return isElementAccessExpression ( node ) && (
2077
2072
isStringOrNumericLiteralLike ( node . argumentExpression ) ||
2078
2073
isWellKnownSymbolSyntactically ( node . argumentExpression ) ) ;
2079
2074
}
2080
2075
2076
+ /** Any series of property and element accesses. */
2081
2077
export function isBindableStaticAccessExpression ( node : Node , excludeThisKeyword ?: boolean ) : node is BindableStaticAccessExpression {
2082
2078
return isPropertyAccessExpression ( node ) && ( ! excludeThisKeyword && node . expression . kind === SyntaxKind . ThisKeyword || isBindableStaticNameExpression ( node . expression , /*excludeThisKeyword*/ true ) )
2083
- || isBindableStaticElementAccessExpression ( node , excludeThisKeyword ) ;
2079
+ || isBindableStaticElementAccessExpression ( node , excludeThisKeyword ) ;
2080
+ }
2081
+
2082
+ /** Any series of property and element accesses, ending in a literal element access */
2083
+ export function isBindableStaticElementAccessExpression ( node : Node , excludeThisKeyword ?: boolean ) : node is BindableStaticElementAccessExpression {
2084
+ return isLiteralLikeElementAccess ( node )
2085
+ && ( ( ! excludeThisKeyword && node . expression . kind === SyntaxKind . ThisKeyword ) ||
2086
+ isEntityNameExpression ( node . expression ) ||
2087
+ isBindableStaticAccessExpression ( node . expression , /*excludeThisKeyword*/ true ) ) ;
2084
2088
}
2085
2089
2086
2090
export function isBindableStaticNameExpression ( node : Node , excludeThisKeyword ?: boolean ) : node is BindableStaticNameExpression {
0 commit comments