Skip to content
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

Editorial: EvaluateClassStaticBlockBody cannot throw during function instantiation #2931

Merged
merged 1 commit into from
Feb 14, 2024

Conversation

bakkot
Copy link
Contributor

@bakkot bakkot commented Oct 9, 2022

This changes a ? to a ! in EvaluateClassStaticBlockBody.

FunctionDeclarationInstantiation only throws if there is a parameter expression (computed member in destructuring, or default value) which throws. In this case the "function object" being evaluated is a synthetic value created by ClassStaticBlockDefinitionEvaluation which is used to explain how static blocks work (threaded through from ClassDefinitionEvaluation step 31.b.ii). This synthetic value does not have any parameters, so FunctionDeclarationInstantiation on it cannot throw.

@ljharb ljharb added the es2024 to be landed before es2024 label Feb 14, 2024
@bakkot bakkot force-pushed the evaluation-empty-static-block branch from 25de6ee to c23f1b7 Compare February 14, 2024 23:18
@bakkot bakkot added the ready to merge Editors believe this PR needs no further reviews, and is ready to land. label Feb 14, 2024
…instantiation (#2931)

FunctionDeclarationInstantiation only throws if there is a parameter expression (computed member in destructuring, or default value) which throws. In this case the "function object" being evaluated is a synthetic value created by ClassStaticBlockDefinitionEvaluation which is used to explain how static blocks work. This synthetic value does not have any parameters, so FunctionDeclarationInstantiation on it cannot throw.
@ljharb ljharb force-pushed the evaluation-empty-static-block branch from c23f1b7 to e20763a Compare February 14, 2024 23:20
@ljharb ljharb merged commit e20763a into main Feb 14, 2024
@ljharb ljharb deleted the evaluation-empty-static-block branch February 14, 2024 23:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
editorial change es2024 to be landed before es2024 ready to merge Editors believe this PR needs no further reviews, and is ready to land.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants