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 {
25072507 }
25082508
25092509 /** True if has initializer node attached to it. */
2510- /* @internal */
25112510 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+ }
25132523 }
25142524
25152525 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 {
37873787 function isJSDocCommentContainingNode ( node : Node ) : boolean ;
37883788 function isSetAccessor ( node : Node ) : node is SetAccessorDeclaration ;
37893789 function isGetAccessor ( node : Node ) : node is GetAccessorDeclaration ;
3790+ /** True if has initializer node attached to it. */
3791+ function hasOnlyExpressionInitializer ( node : Node ) : node is HasExpressionInitializer ;
37903792 function isObjectLiteralElement ( node : Node ) : node is ObjectLiteralElement ;
37913793 function isStringLiteralLike ( node : Node ) : node is StringLiteralLike ;
37923794}
Original file line number Diff line number Diff line change @@ -3787,6 +3787,8 @@ declare namespace ts {
37873787 function isJSDocCommentContainingNode ( node : Node ) : boolean ;
37883788 function isSetAccessor ( node : Node ) : node is SetAccessorDeclaration ;
37893789 function isGetAccessor ( node : Node ) : node is GetAccessorDeclaration ;
3790+ /** True if has initializer node attached to it. */
3791+ function hasOnlyExpressionInitializer ( node : Node ) : node is HasExpressionInitializer ;
37903792 function isObjectLiteralElement ( node : Node ) : node is ObjectLiteralElement ;
37913793 function isStringLiteralLike ( node : Node ) : node is StringLiteralLike ;
37923794}
You can’t perform that action at this time.
0 commit comments