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 @@ -7054,9 +7054,19 @@ namespace ts {
70547054 }
70557055
70567056 /** True if has initializer node attached to it. */
7057- /* @internal */
70587057 export function hasOnlyExpressionInitializer ( node : Node ) : node is HasExpressionInitializer {
7059- return hasInitializer ( node ) && ! isForStatement ( node ) && ! isForInStatement ( node ) && ! isForOfStatement ( node ) && ! isJsxAttribute ( node ) ;
7058+ switch ( node . kind ) {
7059+ case SyntaxKind . VariableDeclaration :
7060+ case SyntaxKind . Parameter :
7061+ case SyntaxKind . BindingElement :
7062+ case SyntaxKind . PropertySignature :
7063+ case SyntaxKind . PropertyDeclaration :
7064+ case SyntaxKind . PropertyAssignment :
7065+ case SyntaxKind . EnumMember :
7066+ return true ;
7067+ default :
7068+ return false ;
7069+ }
70607070 }
70617071
70627072 export function isObjectLiteralElement ( node : Node ) : node is ObjectLiteralElement {
Original file line number Diff line number Diff line change @@ -3612,6 +3612,8 @@ declare namespace ts {
36123612 function isJSDocCommentContainingNode ( node : Node ) : boolean ;
36133613 function isSetAccessor ( node : Node ) : node is SetAccessorDeclaration ;
36143614 function isGetAccessor ( node : Node ) : node is GetAccessorDeclaration ;
3615+ /** True if has initializer node attached to it. */
3616+ function hasOnlyExpressionInitializer ( node : Node ) : node is HasExpressionInitializer ;
36153617 function isObjectLiteralElement ( node : Node ) : node is ObjectLiteralElement ;
36163618 function isStringLiteralLike ( node : Node ) : node is StringLiteralLike ;
36173619}
Original file line number Diff line number Diff line change @@ -3612,6 +3612,8 @@ declare namespace ts {
36123612 function isJSDocCommentContainingNode ( node : Node ) : boolean ;
36133613 function isSetAccessor ( node : Node ) : node is SetAccessorDeclaration ;
36143614 function isGetAccessor ( node : Node ) : node is GetAccessorDeclaration ;
3615+ /** True if has initializer node attached to it. */
3616+ function hasOnlyExpressionInitializer ( node : Node ) : node is HasExpressionInitializer ;
36153617 function isObjectLiteralElement ( node : Node ) : node is ObjectLiteralElement ;
36163618 function isStringLiteralLike ( node : Node ) : node is StringLiteralLike ;
36173619}
You can’t perform that action at this time.
0 commit comments