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 {
7054
7054
}
7055
7055
7056
7056
/** True if has initializer node attached to it. */
7057
- /* @internal */
7058
7057
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
+ }
7060
7070
}
7061
7071
7062
7072
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 {
3612
3612
function isJSDocCommentContainingNode ( node : Node ) : boolean ;
3613
3613
function isSetAccessor ( node : Node ) : node is SetAccessorDeclaration ;
3614
3614
function isGetAccessor ( node : Node ) : node is GetAccessorDeclaration ;
3615
+ /** True if has initializer node attached to it. */
3616
+ function hasOnlyExpressionInitializer ( node : Node ) : node is HasExpressionInitializer ;
3615
3617
function isObjectLiteralElement ( node : Node ) : node is ObjectLiteralElement ;
3616
3618
function isStringLiteralLike ( node : Node ) : node is StringLiteralLike ;
3617
3619
}
Original file line number Diff line number Diff line change @@ -3612,6 +3612,8 @@ declare namespace ts {
3612
3612
function isJSDocCommentContainingNode ( node : Node ) : boolean ;
3613
3613
function isSetAccessor ( node : Node ) : node is SetAccessorDeclaration ;
3614
3614
function isGetAccessor ( node : Node ) : node is GetAccessorDeclaration ;
3615
+ /** True if has initializer node attached to it. */
3616
+ function hasOnlyExpressionInitializer ( node : Node ) : node is HasExpressionInitializer ;
3615
3617
function isObjectLiteralElement ( node : Node ) : node is ObjectLiteralElement ;
3616
3618
function isStringLiteralLike ( node : Node ) : node is StringLiteralLike ;
3617
3619
}
You can’t perform that action at this time.
0 commit comments