microsoft / TypeScript Public
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
align ClassStaticBlockDeclaration with IIFE in CFA #44969
base: main
Are you sure you want to change the base?
Conversation
| !hasSyntacticModifier(node, ModifierFlags.Async) && | ||
| !(node as FunctionLikeDeclaration).asteriskToken && | ||
| !!getImmediatelyInvokedFunctionExpression(node)) || | ||
| node.kind === SyntaxKind.ClassStaticBlockDeclaration; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure how to format these lines, so here is how prettier handles it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would have done it slightly differently, but prettier's format is fine.
src/compiler/binder.ts
Outdated
| @@ -657,19 +657,23 @@ namespace ts { | |||
| const saveExceptionTarget = currentExceptionTarget; | |||
| const saveActiveLabelList = activeLabelList; | |||
| const saveHasExplicitReturn = hasExplicitReturn; | |||
| const isIIFE = containerFlags & ContainerFlags.IsFunctionExpression && !hasSyntacticModifier(node, ModifierFlags.Async) && | |||
| !(node as FunctionLikeDeclaration).asteriskToken && !!getImmediatelyInvokedFunctionExpression(node); | |||
| const isIIFELike = | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| const isIIFELike = | |
| const isImmediatelyInvoked = |
(or isImmediate for even more old-school flavor)
| !hasSyntacticModifier(node, ModifierFlags.Async) && | ||
| !(node as FunctionLikeDeclaration).asteriskToken && | ||
| !!getImmediatelyInvokedFunctionExpression(node)) || | ||
| node.kind === SyntaxKind.ClassStaticBlockDeclaration; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would have done it slightly differently, but prettier's format is fine.
|
Hi! I just left a new test case at the issue which you might want to check! Would be awesome if that case was covered by your fix, too! |
Fixes #44949
The text was updated successfully, but these errors were encountered: