Normative: Add using and await using Declarations, SuppressedError, DisposableStack, and AsyncDisposableStack#3000
Conversation
b7b82d5 to
17e0bc0
Compare
|
I'm not quite sure how to address the remaining esmeta issues. |
|
Rather than suggest changes here, I've made a PR against this PR's branch: rbuckton#2 |
|
This last commit adds a few UpdateEmpty calls that aren't strictly necessary, but |
|
@rbuckton Sorry about that - esmeta is still a little imprecise. You should feel free to write the spec text you want and not worry about esmeta's errors, and we can update esmeta or the ignore file. |
I replaced the |
|
Please note, I've created rbuckton#3 as a separate PR against this one containing the additional specification changes that would be necessary to support https://github.com/tc39/proposal-async-explicit-resource-management, should it advance to Stage 3. |
|
I found an issue with the change in e4f2d05 to use an EE to restrict binding patterns, in that it results in an ambiguous parse of I've filed tc39/proposal-explicit-resource-management#152 against the proposal spec, and will update this PR in due time. |
tc39/proposal-explicit-resource-management#152 has merged, and I've amended this PR to match as part of 3044fd9. |
This comment was marked as duplicate.
This comment was marked as duplicate.
|
This now includes the |
|
Note to implementers: There is a typo in |
|
This is also missing the consensus change to use |
|
This needs to be rebased before it can be merged, and it's not a trivial one. |
c06512e to
f2e685b
Compare
|
Squashed and rebased to simplify history and make things easier. |
f2e685b to
1ae839f
Compare
Updated. Can you take another look? |
|
Looks like that resolves all my nits. |
bcb9acd to
d7e588c
Compare
Mind approving then? It shows you as having open requested changes. |
…r, DisposableStack, and AsyncDisposableStack (tc39#3000) * Spec text for proposal-explicit-resource-management * Fix lint errors * Run formatter * Fix signature for DisposeResources * Fixes for some esmeta warnings * Fixes for some esmeta warnings * Add missing ReturnIfAbrupt in DisposableStack.prototype.use * More ecmarkup signature fixes * Change DisposeResources signature to return completion record * Order sections by property name * Syntax of types * id of AO clause doesn't need to include param names * Avoid the use of `Type()` * Use preamble conventions from PR tc39#2592 * Interface names are put in `<i>` rather than `<em>` * A 'Slots' table should have a 'Type' column * Add 'UsingDeclaration' to Annex A * misc minor fixes * add description suggestion from @jmdyck * Add DisposeCapabilityRecord from tc39/proposal-explicit-resource-management#144 * Wrap UpdateEmpty calls in calls to Completion * Run formatter * Run formatter again * Fix formatting and capitalization * Clean up DisposeResources signature, replace UpdateEmpty with assertions * Add 'either' in front of 'null or undefined' * Use CreateBuiltinFunction * Address additional editor feedback (from async PR) * Move BindingPattern restriction for 'using' to an early error * Fix typo in using declaration early errors * Fix typos * run formatter * Remove InstallErrorCause from SuppressedError, per 2023-jan consensus * Spec text for proposal-async-explicit-resource-management * Run formatter * Add 'either' in front of 'null or undefined' * Address editor feedback * Address additional editor feedback * Switch back to a production parameter, update ASI note * Remove 'await' restriction per March 2023 consensus. See tc39/proposal-explicit-resource-management#153 * Adopt consensus changes from tc39/proposal-explicit-resource-management#178 * Adopt consensus changes from tc39/proposal-explicit-resource-management#180 * Adopt typo fix from tc39/proposal-explicit-resource-management#217 * Fix typos and add temporary PR note * Remove temporary PR note * Remaining consensus updates from proposal repo * Add missing undefined check in GetDisposeMethod * Fix DisposeCapability leak * fix formatting * Switch to empty list * Update text of NOTE * Add PromiseCapability wrapper around sync dispose in an `await using` * Fix missing lookahead restriction * Remove superfluous ClassBody restriction * Add entries to esmeta-ignore * Reduce unnecessary Awaits for nullish values in blocks containing `await using` * Add missing 'constructor' definitions * Disallow using/await using in a switch case/default clause * Fix formatting * PR feedback * minor fixes * Switch from @@ to % in a few more places * Update esmeta-ignore.json * Update asyncDispose to be an async method * avoid threading kind through all the InitializeBinding machinery * rename _kind_ to _declarationKind_ in ForIn/OfBodyEvaluation since there's already _iterationKind_ and _lhsKind_ * move _declarationKind_ into the branch where that makes sense otherwise we're calling IsUsingDeclaration/IsAwaitUsingDeclaration on potentially an assignment target or var declaration, which they aren't defined over. * move it back * PR Feedback * Some missing changes pulled from #11 * Fix some remaining suggestions from #7 * Switch to `<em>` where appropriate * PR feedback * Don't overwrite completion parameter in DisposeResources * The spec usually uses lower-case for ids. * Drop 'variants' attribute * Changes to Annex A to make it parallel to main-body grammar * Add subclauses to "Constructor Properties of The Global Object" * Need to define ForDeclarationBindingInitialization for ForDeclaration * Remove unreachable SDO rules * Remove more unreachable SDO rules * Remove unnecessary steps in CreateDisposableResource * Add explicit return to algorithm * EvaluateClassStaticBlockBody: add an Assert * Remove 'kind' description from InitializeBinding * CaseBlock can't have resources, so just assert * Restore missing NOTE and fix indentation * ContainsUsing and HasUnterminatedUsingDeclaration are identical * Rename V to value and O to obj * Use list shorthand for NewDisposeCapability * Rely on NOTE rather than overwriting [[DisposableResourceStack]] * Add type to clauses and use 'this method' * Merge branch 'main' into explicit-resource-management * Revert changes to esmeta-ignore.json * PR fix type and function/method usage * Additional editorial feedback * Refactor out DisposeCapability * Fix internal slot typo * Remove unused Dispose AO * Editorial feedback * Remove excess argument to 'return' method * Restore 'then' in assertion * Restore old ids * SuppressedError.prototype description * Revert 'this function'->'this method' * 'property'->'properties' in (Async)Disposable interface desc * Other editorial feedback * no list for mutually exclusive states * Align aliases with tc39#3873 * PR feedback * Symbol description wording * Merge pull request #17 from rbuckton/excess-iter-return-argument Remove excess argument to 'return' method * Revert function->method changes
using and await using Declarations, SuppressedError, DisposableStack, and AsyncDisposableStackusing and await using Declarations, SuppressedError, DisposableStack, and AsyncDisposableStack
d7e588c to
f792966
Compare
This PR contains the Stage 3 specification text for Explicit Resource Management.