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

Fix missing lookahead restriction #222

Merged
merged 1 commit into from
Apr 10, 2024
Merged

Conversation

rbuckton
Copy link
Collaborator

@rbuckton rbuckton commented Mar 22, 2024

This fixes a missing lookahead restriction to prevent export await using like we do for export using that was overlooked when we chose await using over using await.

The PR against ecma262 is being tracked in rbuckton/ecma262#4

Copy link

A preview of this PR can be found at https://tc39.es/proposal-explicit-resource-management/pr/222.

@rbuckton rbuckton added bug Something isn't working normative Indicates a normative change to the specification labels Mar 22, 2024
@rbuckton
Copy link
Collaborator Author

I should note that this is another bugfix intended to align with consensus.

@rbuckton rbuckton added the needs-consensus A pull request that needs consensus at TC39 plenary label Mar 29, 2024
Copy link

@syg syg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Editorially lgtm, though I don't recall the particular consensus atm and happy to take your word for it.

@rbuckton
Copy link
Collaborator Author

rbuckton commented Apr 1, 2024

Editorially lgtm, though I don't recall the particular consensus atm and happy to take your word for it.

This was a long time policy since the adoption of RAII mechanics in Stage 2. There is no reason to export a disposable since it will be disposed as soon as the module finishes loading, so we banned export using (and export using await, prior to the syntax switch). We do still permit using x = ...; export { x }; if the user has a specific need for that ability, but we still want to discourage the simple form as it is more than likely an indication of a bug.

@rbuckton rbuckton added the has-consensus Indicates a pull request reached consensus at TC39 plenary. label Apr 10, 2024
@rbuckton rbuckton merged commit fd4da06 into main Apr 10, 2024
1 check passed
@rbuckton rbuckton deleted the fix-missing-lookahead-restriction branch April 10, 2024 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working has-consensus Indicates a pull request reached consensus at TC39 plenary. needs-consensus A pull request that needs consensus at TC39 plenary normative Indicates a normative change to the specification
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants