fix: support mutated outer decorated class binding#16387
Merged
JLHwung merged 3 commits intobabel:mainfrom Mar 28, 2024
Merged
Conversation
JLHwung
commented
Mar 27, 2024
| @@ -0,0 +1,145 @@ | |||
| { | |||
Collaborator
|
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/56585 |
JLHwung
commented
Mar 27, 2024
| t.variableDeclarator(t.cloneNode(classOuterBindingLocal)), | ||
| t.variableDeclarator(classOuterBindingDelegateLocal), | ||
| ]), | ||
| t.blockStatement([ |
Contributor
Author
There was a problem hiding this comment.
We use a block statement to simulate the inner scope so that it can inherit the Yield and Await production parameter.
nicolo-ribaudo
approved these changes
Mar 27, 2024
| @capture(() => K) | ||
| @assertUninitialized(() => K) | ||
| class K { | ||
| //todo: add the assertUninitialized decorator when we properly implement class tdz |
Member
There was a problem hiding this comment.
Could you for now assert that we throw the TDZ error, so that when we fix it we don't forget to update the test?
liuxingbaoyu
approved these changes
Mar 28, 2024
This was referenced May 18, 2024
This was referenced May 20, 2024
This was referenced Jun 27, 2024
This was referenced Jun 27, 2024
This was referenced Jun 27, 2024
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In this PR we generate an dedicated scope for a decorated class when its outer class binding will be mutated, because the class method, decorators and computed keys may still refer to the internal class binding.
This PR does not improve current class tdz check.