diff --git a/spec.emu b/spec.emu index cec5e1b..df3067d 100644 --- a/spec.emu +++ b/spec.emu @@ -879,7 +879,7 @@ contributors: Ron Buckton, Ecma International InitializeReferencedBinding ( _V_: unknown, _W_: unknown, - _hint_: either ~normal~, ~sync-dispose~, or ~async-dispose~, + _hint_: one of ~normal~, ~sync-dispose~, or ~async-dispose~, ): either a normal completion containing ~unused~ or an abrupt completion
@@ -1011,23 +1011,23 @@ contributors: Ron Buckton, Ecma International _V_ : an ECMAScript language value, _hint_ : either ~sync-dispose~ or ~async-dispose~, optional _method_ : a function object, - ) + ): either a normal completion containing ~unused~ or a throw completion
1. If _method_ is not present then, 1. If _V_ is either *null* or *undefined* and _hint_ is ~sync-dispose~, then - 1. Return NormalCompletion(~empty~). + 1. Return ~unused~. 1. Let _resource_ be ? CreateDisposableResource(_V_, _hint_). 1. Else, 1. If _V_ is either *null* or *undefined*, then 1. Let _resource_ be ? CreateDisposableResource(*undefined*, _hint_, _method_). 1. Else, - 1. If Type(_V_) is not Object, throw a *TypeError* exception. + 1. If _V_ is not an Object, throw a *TypeError* exception. 1. Let _resource_ be ? CreateDisposableResource(_V_, _hint_, _method_). 1. Append _resource_ to _disposeCapability_.[[DisposableResourceStack]]. - 1. Return NormalCompletion(~empty~). + 1. Return ~unused~. @@ -1037,7 +1037,7 @@ contributors: Ron Buckton, Ecma International _V_ : an ECMAScript language value, _hint_ : either ~sync-dispose~ or ~async-dispose~, optional _method_ : a function object, - ) + ): either a normal completion containing a DisposableResource Record or a throw completion
@@ -1046,7 +1046,7 @@ contributors: Ron Buckton, Ecma International 1. Set _V_ to *undefined*. 1. Set _method_ to *undefined*. 1. Else, - 1. If Type(_V_) is not Object, throw a *TypeError* exception. + 1. If _V_ is not an Object, throw a *TypeError* exception. 1. Set _method_ to ? GetDisposeMethod(_V_, _hint_). 1. If _method_ is *undefined*, throw a *TypeError* exception. 1. Else, @@ -1060,7 +1060,7 @@ contributors: Ron Buckton, Ecma International GetDisposeMethod ( _V_ : an Object, _hint_ : either ~sync-dispose~ or ~async-dispose~, - ) + ): either a normal completion containing either a function object or *undefined*, or a throw completion
@@ -1080,7 +1080,7 @@ contributors: Ron Buckton, Ecma International _V_ : an Object or *undefined*, _hint_ : either ~sync-dispose~ or ~async-dispose~, _method_ : a function object or *undefined*, - ) + ): either a normal completion containing *undefined* or a throw completion
@@ -1096,12 +1096,12 @@ contributors: Ron Buckton, Ecma International

DisposeResources ( _disposeCapability_ : a DisposeCapability Record, - _completion_ : a Completion Record, - ): a Completion Record + _completion_: either a normal completion containing either an ECMAScript language value or ~empty~, or an abrupt completion, + ): either a normal completion containing either an ECMAScript language value or ~empty~, or an abrupt completion

- 1. For each _resource_ of _disposeCapability_.[[DisposableResourceStack]], in reverse list order, do + 1. For each _resource_ of _disposeCapability_.[[DisposableResourceStack]], in reverse List order, do 1. Let _result_ be Dispose(_resource_.[[ResourceValue]], _resource_.[[Hint]], _resource_.[[DisposeMethod]]). 1. If _result_.[[Type]] is ~throw~, then 1. If _completion_.[[Type]] is ~throw~, then @@ -1459,7 +1459,11 @@ contributors: Ron Buckton, Ecma International 1. Return *false*. - LexicalDeclaration : UsingDeclaration + + UsingDeclaration : + `using` BindingList `;` + `using` `await` BindingList `;` + 1. Return *true*. @@ -1530,6 +1534,10 @@ contributors: Ron Buckton, Ecma International 1. Return *true*. + ForDeclaration : LetOrConst ForBinding + + 1. Return *false*. + ForDeclaration : `using` ForBinding 1. Return *false*. @@ -1879,7 +1887,7 @@ contributors: Ron Buckton, Ecma International InitializeBinding ( _N_: a String, _V_: an ECMAScript language value, - _hint_: either ~normal~, ~sync-dispose~, or ~async-dispose~, + _hint_: one of ~normal~, ~sync-dispose~, or ~async-dispose~, ): a normal completion containing ~unused~
@@ -1907,7 +1915,7 @@ contributors: Ron Buckton, Ecma International InitializeBinding ( _N_: a String, _V_: an ECMAScript language value, - _hint_: either ~normal~, ~sync-dispose~, or ~async-dispose~, + _hint_: one of ~normal~, ~sync-dispose~, or ~async-dispose~, ): either a normal completion containing ~unused~ or a throw completion
@@ -1937,7 +1945,7 @@ contributors: Ron Buckton, Ecma International InitializeBinding ( _N_: a String, _V_: an ECMAScript language value, - _hint_: either ~normal~, ~sync-dispose~, or ~async-dispose~, + _hint_: one of ~normal~, ~sync-dispose~, or ~async-dispose~, ): either a normal completion containing ~unused~ or a throw completion
@@ -2297,7 +2305,7 @@ contributors: Ron Buckton, Ecma International

Runtime Semantics: BindingEvaluation ( - _hint_: either ~normal~, ~sync-dispose~, or ~async-dispose~. + _hint_: one of ~normal~, ~sync-dispose~, or ~async-dispose~. ): either a normal completion containing ~unused~ or an abrupt completion

@@ -2580,7 +2588,8 @@ contributors: Ron Buckton, Ecma International 1. Assert: _lhs_ is a |ForDeclaration|. 1. Let _status_ be Completion(ForDeclarationBindingInitialization of _lhs_ with arguments _nextValue_ and _iterationEnv_). 1. If _status_ is an abrupt completion, then - 1. Set _status_ to DisposeResources(_iterationEnv_, _status_). + 1. If _iterationEnv_ is not *undefined*, then + 1. Set _status_ to DisposeResources(_iterationEnv_, _status_). 1. Set the running execution context's LexicalEnvironment to _oldEnv_. 1. If _iteratorKind_ is ~async~, return ? AsyncIteratorClose(_iteratorRecord_, _status_). 1. If _iterationKind_ is ~enumerate~, then @@ -2589,7 +2598,8 @@ contributors: Ron Buckton, Ecma International 1. Assert: _iterationKind_ is ~iterate~. 1. Return ? IteratorClose(_iteratorRecord_, _status_). 1. Let _result_ be the result of evaluating _stmt_. - 1. Set _result_ to DisposeResources(_iterationEnv_, _result_). + 1. If _iterationEnv_ is not *undefined*, then + 1. Set _result_ to DisposeResources(_iterationEnv_, _result_). 1. Set the running execution context's LexicalEnvironment to _oldEnv_. 1. If LoopContinues(_result_, _labelSet_) is *false*, then 1. If _iterationKind_ is ~enumerate~, then @@ -3342,7 +3352,7 @@ contributors: Ron Buckton, Ecma International `export` ExportFromClause FromClause `;` `export` NamedExports `;` `export` VariableStatement[~Yield, +Await] - `export` [lookahead ∉ { `using` }] Declaration[~Yield, +Await] + `export` [lookahead != `using`] Declaration[~Yield, +Await] `export` `default` HoistableDeclaration[~Yield, +Await, +Default] `export` `default` ClassDeclaration[~Yield, +Await, +Default] `export` `default` [lookahead ∉ {`function`, `async` [no |LineTerminator| here] `function`, `class`}] AssignmentExpression[+In, ~Yield, +Await] `;` @@ -3539,11 +3549,11 @@ contributors: Ron Buckton, Ecma International 1. If NewTarget is *undefined*, let _newTarget_ be the active function object; else let _newTarget_ be NewTarget. 1. Let _O_ be ? OrdinaryCreateFromConstructor(_newTarget_, *"%SuppressedError.prototype%"*, « [[ErrorData]] »). 1. If _message_ is not *undefined*, then - 1. Let _msg_ be ? ToString(_message_). - 1. Perform CreateNonEnumerableDataPropertyOrThrow(_O_, *"message"*, _msg_). + 1. Let _messageString_ be ? ToString(_message_). + 1. Perform CreateNonEnumerableDataPropertyOrThrow(_O_, *"message"*, _messageString_). 1. Perform ? InstallErrorCause(_O_, _options_). - 1. Perform ! CreateNonEnumerableDataPropertyOrThrow(_O_, *"error"*, _error_). - 1. Perform ! CreateNonEnumerableDataPropertyOrThrow(_O_, *"suppressed"*, _suppressed_). + 1. Perform CreateNonEnumerableDataPropertyOrThrow(_O_, *"error"*, _error_). + 1. Perform CreateNonEnumerableDataPropertyOrThrow(_O_, *"suppressed"*, _suppressed_). 1. Return _O_. @@ -3832,23 +3842,12 @@ contributors: Ron Buckton, Ecma International 1. Perform ? RequireInternalSlot(_disposableStack_, [[DisposableState]]). 1. If _disposableStack_.[[DisposableState]] is ~disposed~, throw a *ReferenceError* exception. 1. If IsCallable(_onDispose_) is *false*, throw a *TypeError* exception. - 1. Let _F_ be a new built-in function object as defined in . - 1. Set _F_.[[Argument]] to _value_. - 1. Set _F_.[[OnDisposeCallback]] to _onDispose_. + 1. Let _closure_ be a new Abstract Closure with no parameters that captures _value_ and _onDispose_ and performs the following steps when called: + 1. Return ? Call(_onDispose_, *undefined*, « _value_ »). + 1. Let _F_ be CreateBuiltinFunction(_closure_, 0, *""*, « »). 1. Perform ? AddDisposableResource(_disposableStack_.[[DisposeCapability]], *undefined*, ~sync-dispose~, _F_). 1. Return _value_. - - -

DisposableStack Adopt Callback Functions

-

A DisposableStack adopt callback function is an anonymous built-in function object that has [[Argument]] and [[OnDisposeCallback]] internal slots.

-

When a DisposableStack adopt callback function is called, the following steps are taken:

- - 1. Let _F_ be the active function object. - 1. Assert: IsCallable(_F_.[[OnDisposeCallback]]) is *true*. - 1. Return Call(_F_.[[OnDisposeCallback]], *undefined*, « _F_.[[Argument]] »). - -
@@ -4039,23 +4038,12 @@ contributors: Ron Buckton, Ecma International 1. Perform ? RequireInternalSlot(_asyncDisposableStack_, [[AsyncDisposableState]]). 1. If _asyncDisposableStack_.[[AsyncDisposableState]] is ~disposed~, throw a *ReferenceError* exception. 1. If IsCallable(_onDisposeAsync_) is *false*, throw a *TypeError* exception. - 1. Let _F_ be a new built-in function object as defined in . - 1. Set _F_.[[Argument]] to _value_. - 1. Set _F_.[[OnDisposeAsyncCallback]] to _onDisposeAsync_. + 1. Let _closure_ be a new Abstract Closure with no parameters that captures _value_ and _onDisposeAsync_ and performs the following steps when called: + 1. Return ? Call(_onDisposeAsync_, *undefined*, « _value_ »). + 1. Let _F_ be CreateBuiltinFunction(_closure_, 0, *""*, « »). 1. Perform ? AddDisposableResource(_asyncDisposableStack_.[[DisposeCapability]], *undefined*, ~async-dispose~, _F_). 1. Return _value_. - - -

AsyncDisposableStack Adopt Callback Functions

-

An AsyncDisposableStack adopt callback function is an anonymous built-in function that has [[Argument]] and [[OnDisposeAsyncCallback]] internal slots.

-

When an AsyncDisposableStack adopt callback function is called, the following steps are taken:

- - 1. Let _F_ be the active function object. - 1. Assert: IsCallable(_F_.[[OnDisposeAsyncCallback]]) is *true*. - 1. Return Call(_F_.[[OnDisposeAsyncCallback]], *undefined*, « _F_.[[Argument]] »). - -