Closed rbuckton closed 2 months ago
A preview of this PR can be found at https://tc39.es/proposal-explicit-resource-management/pr/222.
I should note that this is another bugfix intended to align with consensus.
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.
This fixes a missing lookahead restriction to prevent
export await using
like we do forexport using
that was overlooked when we choseawait using
overusing await
.The PR against ecma262 is being tracked in https://github.com/rbuckton/ecma262/pull/4