tc39 / proposal-explicit-resource-management

ECMAScript Explicit Resource Management
https://arai-a.github.io/ecma262-compare/?pr=3000
BSD 3-Clause "New" or "Revised" License
758 stars 30 forks source link

Ban 'await' as an identifier in 'using' #138

Closed rbuckton closed 1 year ago

rbuckton commented 1 year ago

This bans the use of await as an identifier in a using declaration, to ensure forwards compatibility with https://github.com/tc39/proposal-async-explicit-resource-management/. This is necessary because await is a valid BindingIdentifier in non-strict-mode code, per 13.1.1 Static Semantics: Early Errors, and using declarations are legal in non-strict-mode code.

If we do not explicitly ban await, we would be unable to introduce the using await declaration due to the syntactic ambiguity.

github-actions[bot] commented 1 year ago

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

rbuckton commented 1 year ago

This was approved by consensus in the January 2023 TC39 plenary session.