File tree Expand file tree Collapse file tree 3 files changed +16
-2
lines changed
tests/baselines/reference/api Expand file tree Collapse file tree 3 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -2507,9 +2507,19 @@ namespace ts {
2507
2507
}
2508
2508
2509
2509
/** True if has initializer node attached to it. */
2510
- /* @internal */
2511
2510
export function hasOnlyExpressionInitializer ( node : Node ) : node is HasExpressionInitializer {
2512
- return hasInitializer ( node ) && ! isForStatement ( node ) && ! isForInStatement ( node ) && ! isForOfStatement ( node ) && ! isJsxAttribute ( node ) ;
2511
+ switch ( node . kind ) {
2512
+ case SyntaxKind . VariableDeclaration :
2513
+ case SyntaxKind . Parameter :
2514
+ case SyntaxKind . BindingElement :
2515
+ case SyntaxKind . PropertySignature :
2516
+ case SyntaxKind . PropertyDeclaration :
2517
+ case SyntaxKind . PropertyAssignment :
2518
+ case SyntaxKind . EnumMember :
2519
+ return true ;
2520
+ default :
2521
+ return false ;
2522
+ }
2513
2523
}
2514
2524
2515
2525
export function isObjectLiteralElement ( node : Node ) : node is ObjectLiteralElement {
Original file line number Diff line number Diff line change @@ -3787,6 +3787,8 @@ declare namespace ts {
3787
3787
function isJSDocCommentContainingNode ( node : Node ) : boolean ;
3788
3788
function isSetAccessor ( node : Node ) : node is SetAccessorDeclaration ;
3789
3789
function isGetAccessor ( node : Node ) : node is GetAccessorDeclaration ;
3790
+ /** True if has initializer node attached to it. */
3791
+ function hasOnlyExpressionInitializer ( node : Node ) : node is HasExpressionInitializer ;
3790
3792
function isObjectLiteralElement ( node : Node ) : node is ObjectLiteralElement ;
3791
3793
function isStringLiteralLike ( node : Node ) : node is StringLiteralLike ;
3792
3794
}
Original file line number Diff line number Diff line change @@ -3787,6 +3787,8 @@ declare namespace ts {
3787
3787
function isJSDocCommentContainingNode ( node : Node ) : boolean ;
3788
3788
function isSetAccessor ( node : Node ) : node is SetAccessorDeclaration ;
3789
3789
function isGetAccessor ( node : Node ) : node is GetAccessorDeclaration ;
3790
+ /** True if has initializer node attached to it. */
3791
+ function hasOnlyExpressionInitializer ( node : Node ) : node is HasExpressionInitializer ;
3790
3792
function isObjectLiteralElement ( node : Node ) : node is ObjectLiteralElement ;
3791
3793
function isStringLiteralLike ( node : Node ) : node is StringLiteralLike ;
3792
3794
}
You can’t perform that action at this time.
0 commit comments