align ClassStaticBlockDeclaration with IIFE in CFA#44969
align ClassStaticBlockDeclaration with IIFE in CFA#44969rbuckton merged 6 commits intomicrosoft:mainfrom
Conversation
| !hasSyntacticModifier(node, ModifierFlags.Async) && | ||
| !(node as FunctionLikeDeclaration).asteriskToken && | ||
| !!getImmediatelyInvokedFunctionExpression(node)) || | ||
| node.kind === SyntaxKind.ClassStaticBlockDeclaration; |
There was a problem hiding this comment.
I am not sure how to format these lines, so here is how prettier handles it.
There was a problem hiding this comment.
I would have done it slightly differently, but prettier's format is fine.
src/compiler/binder.ts
Outdated
| 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.
| 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.
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! |
|
Anything missing here but the last review? I'd love to retest this in the nightly build as soon as it is merged! |
|
@rbuckton please take a look. |
|
I'll have the bot run some extensive tests to make sure there's no other side effects from this change. |
|
@typescript-bot run dt |
|
The user suite test run you requested has finished and failed. I've opened a PR with the baseline diff from master. |
|
None of the reported test failures look to be related to this change. I think this is good to merge. |
|
Sorry to be unfamiliar with your process, but could you tell me how I can see which milestone / release this fix will be in? |
|
And also not part of the latest nightly build (if I didn't do something wrong when trying to test with the nightly)... |
|
Did you try 4.7.0-dev.20220329? |
|
Oh, my fault. Has arrived in nightly and works perfectly! |
|
My reproducer is now also fixed in TypeScript playground when choosing "nightly" ☺ |
Fixes #44949
Fixes #45932