Skip to content
This repository was archived by the owner on Sep 8, 2021. It is now read-only.

Disallow 'await' identifiers in 'static' blocks#32

Merged
rbuckton merged 1 commit intomasterfrom
disallowAwait
Jan 15, 2021
Merged

Disallow 'await' identifiers in 'static' blocks#32
rbuckton merged 1 commit intomasterfrom
disallowAwait

Conversation

@rbuckton
Copy link
Copy Markdown
Collaborator

This disallows await in BindingIdentifier, LabelIdentifier, or IdentifierReference productions in static blocks so that we can leave the option to allow await expressions in the future.

Fixes #27

@bakkot
Copy link
Copy Markdown
Member

bakkot commented Jan 14, 2021

This disallows such identifiers even in non-async context. That's surprising to me.

@rbuckton
Copy link
Copy Markdown
Collaborator Author

The idea is to "fail closed". We disallow them now so that we can decide on whether to carry over await later. If we decide against that in the future, we can remove the restriction. If we allow await as a variable name now, we have essentially forced this decision.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Disallow await as an IdentifierReference or BindingIdentifier inside of a static block

2 participants