diff --git a/spec.emu b/spec.emu index e2bf4a5..f1ebfbc 100644 --- a/spec.emu +++ b/spec.emu @@ -2286,7 +2286,8 @@ contributors: Ron Buckton, Ecma International 1. Let _DclRec_ be _envRec_.[[DeclarativeRecord]]. 1. If ! _DclRec_.HasBinding(_N_) is *true*, then - 1. Return ! _DclRec_.InitializeBinding(_N_, _V_, _hint_). + 1. Return ! _DclRec_.InitializeBinding(_N_, _V_). + 1. Return ? _DclRec_.InitializeBinding(_N_, _V_, _hint_). 1. Assert: If the binding exists, it must be in the object Environment Record. 1. Assert: _hint_ is ~normal~. 1. Let _ObjRec_ be _envRec_.[[ObjectRecord]]. @@ -2641,7 +2642,7 @@ contributors: Ron Buckton, Ecma International AwaitUsingDeclarationHead : `await` [no LineTerminator here] `using` - + @@ -2787,8 +2788,8 @@ contributors: Ron Buckton, Ecma International 1. Else, 1. Let _rhs_ be the ? Evaluation of |Initializer|. 1. Let _value_ be ? GetValue(_rhs_). - 1. Perform ! InitializeReferencedBinding(_lhs_, _value_, _hint_). - 1. Return ~empty~. + 1. Perform ? InitializeReferencedBinding(_lhs_, _value_, _hint_). + 1. Return ~unused~. LexicalBinding : BindingPattern Initializer @@ -3616,10 +3617,10 @@ contributors: Ron Buckton, Ecma International 1. If the first |CaseClauses| is present, let _has_ be HasCallInTailPosition of the first |CaseClauses| with argument _call_. 1. If _has_ is *true*, return *true*. 1. If the first |CaseClauses| is present, then - 1. Let _has_ be HasCallInTailPosition of the first |CaseClauses| with argument _call_. + 1. Set _has_ to HasCallInTailPosition of the first |CaseClauses| with argument _call_. 1. If _has_ is *true*, return *true*. 1. If HasUnterminatedUsingDeclaration of the first |CaseClauses| is *true*, return *false*. - 1. Let _has_ be HasCallInTailPosition of |DefaultClause| with argument _call_. + 1. Set _has_ be HasCallInTailPosition of |DefaultClause| with argument _call_. 1. If _has_ is *true*, return *true*. 1. If HasUnterminatedUsingDeclaration of |DefaultClause| is *true*, return *false*. 1. If the second |CaseClauses| is present, let _has_ be HasCallInTailPosition of the second |CaseClauses| with argument _call_. @@ -4012,9 +4013,9 @@ contributors: Ron Buckton, Ecma International 1. Set the Realm of _moduleContext_ to _module_.[[Realm]]. 1. Set the ScriptOrModule of _moduleContext_ to _module_. 1. Assert: _module_ has been linked and declarations in its module environment have been instantiated. - 1. Let _env_ be _module_.[[Environment]]. - 1. Set the VariableEnvironment of _moduleContext_ to _env_. - 1. Set the LexicalEnvironment of _moduleContext_ to _env_. + 1. Let _env_ be _module_.[[Environment]]. + 1. Set the VariableEnvironment of _moduleContext_ to _module_.[[Environment]]_env_. + 1. Set the LexicalEnvironment of _moduleContext_ to _module_.[[Environment]]_env_. 1. Suspend the running execution context. 1. If _module_.[[HasTLA]] is *false*, then 1. Assert: _capability_ is not present. @@ -4336,12 +4337,12 @@ contributors: Ron Buckton, Ecma International 1. Let _O_ be the *this* value. 1. Let _promiseCapability_ be ! NewPromiseCapability(%Promise%). - 1. Let _return_ be GetMethod(_O_, `"return"`). + 1. Let _return_ be Completion(GetMethod(_O_, `"return"`)). 1. IfAbruptRejectPromise(_return_, _promiseCapability_). 1. If _return_ is *undefined*, then 1. Perform ! Call(_promiseCapability_.[[Resolve]], *undefined*, « *undefined* »). 1. Else, - 1. Let _result_ be Call(_return_, _O_, « *undefined* »). + 1. Let _result_ be Completion(Call(_return_, _O_, « *undefined* »)). 1. IfAbruptRejectPromise(_result_, _promiseCapability_). 1. Let _resultWrapper_ be Completion(PromiseResolve(%Promise%, _result_)). 1. IfAbruptRejectPromise(_resultWrapper_, _promiseCapability_). @@ -4496,41 +4497,6 @@ contributors: Ron Buckton, Ecma International
  • does not have a [[DisposableState]] internal slot or any of the other internal slots of DisposableStack instances.
  • - -

    get DisposableStack.prototype.disposed

    -

    `DisposableStack.prototype.disposed` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps:

    - - 1. Let _disposableStack_ be the *this* value. - 1. Perform ? RequireInternalSlot(_disposableStack_, [[DisposableState]]). - 1. If _disposableStack_.[[DisposableState]] is ~disposed~, return *true*. - 1. Otherwise, return *false*. - -
    - - -

    DisposableStack.prototype.dispose ()

    -

    This method performs the following steps when called:

    - - 1. Let _disposableStack_ be the *this* value. - 1. Perform ? RequireInternalSlot(_disposableStack_, [[DisposableState]]). - 1. If _disposableStack_.[[DisposableState]] is ~disposed~, return *undefined*. - 1. Set _disposableStack_.[[DisposableState]] to ~disposed~. - 1. Return DisposeResources(_disposableStack_.[[DisposeCapability]], NormalCompletion(*undefined*)). - -
    - - -

    DisposableStack.prototype.use( _value_ )

    -

    This method performs the following steps when called:

    - - 1. Let _disposableStack_ be the *this* value. - 1. Perform ? RequireInternalSlot(_disposableStack_, [[DisposableState]]). - 1. If _disposableStack_.[[DisposableState]] is ~disposed~, throw a *ReferenceError* exception. - 1. Perform ? AddDisposableResource(_disposableStack_.[[DisposeCapability]], _value_, ~sync-dispose~). - 1. Return _value_. - -
    -

    DisposableStack.prototype.adopt( _value_, _onDispose_ )

    This method performs the following steps when called:

    @@ -4560,6 +4526,29 @@ contributors: Ron Buckton, Ecma International
    + +

    DisposableStack.prototype.dispose ()

    +

    This method performs the following steps when called:

    + + 1. Let _disposableStack_ be the *this* value. + 1. Perform ? RequireInternalSlot(_disposableStack_, [[DisposableState]]). + 1. If _disposableStack_.[[DisposableState]] is ~disposed~, return *undefined*. + 1. Set _disposableStack_.[[DisposableState]] to ~disposed~. + 1. Return DisposeResources(_disposableStack_.[[DisposeCapability]], NormalCompletion(*undefined*)). + +
    + + +

    get DisposableStack.prototype.disposed

    +

    `DisposableStack.prototype.disposed` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps:

    + + 1. Let _disposableStack_ be the *this* value. + 1. Perform ? RequireInternalSlot(_disposableStack_, [[DisposableState]]). + 1. If _disposableStack_.[[DisposableState]] is ~disposed~, return *true*. + 1. Otherwise, return *false*. + +
    +

    DisposableStack.prototype.move()

    This method performs the following steps when called:

    @@ -4576,6 +4565,18 @@ contributors: Ron Buckton, Ecma International
    + +

    DisposableStack.prototype.use( _value_ )

    +

    This method performs the following steps when called:

    + + 1. Let _disposableStack_ be the *this* value. + 1. Perform ? RequireInternalSlot(_disposableStack_, [[DisposableState]]). + 1. If _disposableStack_.[[DisposableState]] is ~disposed~, throw a *ReferenceError* exception. + 1. Perform ? AddDisposableResource(_disposableStack_.[[DisposeCapability]], _value_, ~sync-dispose~). + 1. Return _value_. + +
    +

    DisposableStack.prototype [ @@dispose ] ()

    The initial value of the @@dispose property is %DisposableStack.prototype.dispose%, defined in .

    @@ -4624,7 +4625,7 @@ contributors: Ron Buckton, Ecma International a DisposeCapability Record - Holds the stack of disposable resources. + Resources to be disposed when the disposable stack is disposed. @@ -4690,14 +4691,32 @@ contributors: Ron Buckton, Ecma International
  • does not have an [[AsyncDisposableState]] internal slot or any of the other internal slots of AsyncDisposableStack instances.
  • - -

    get AsyncDisposableStack.prototype.disposed

    -

    `AsyncDisposableStack.prototype.disposed` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps:

    + +

    AsyncDisposableStack.prototype.adopt( _value_, _onDisposeAsync_ )

    +

    This method performs the following steps when called:

    1. Let _asyncDisposableStack_ be the *this* value. 1. Perform ? RequireInternalSlot(_asyncDisposableStack_, [[AsyncDisposableState]]). - 1. If _asyncDisposableStack_.[[AsyncDisposableState]] is ~disposed~, return *true*. - 1. Otherwise, return *false*. + 1. If _asyncDisposableStack_.[[AsyncDisposableState]] is ~disposed~, throw a *ReferenceError* exception. + 1. If IsCallable(_onDisposeAsync_) is *false*, throw a *TypeError* exception. + 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.prototype.defer( _onDisposeAsync_ )

    +

    This method performs the following steps when called:

    + + 1. Let _asyncDisposableStack_ be the *this* value. + 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. Perform ? AddDisposableResource(_asyncDisposableStack_.[[DisposeCapability]], *undefined*, ~async-dispose~, _onDisposeAsync_). + 1. Return *undefined*.
    @@ -4721,44 +4740,14 @@ contributors: Ron Buckton, Ecma International
    - -

    AsyncDisposableStack.prototype.use( _value_ )

    -

    This method performs the following steps when called:

    - - 1. Let _asyncDisposableStack_ be the *this* value. - 1. Perform ? RequireInternalSlot(_asyncDisposableStack_, [[AsyncDisposableState]]). - 1. If _asyncDisposableStack_.[[AsyncDisposableState]] is ~disposed~, throw a *ReferenceError* exception. - 1. Perform ? AddDisposableResource(_asyncDisposableStack_.[[DisposeCapability]], _value_, ~async-dispose~). - 1. Return _value_. - -
    - - -

    AsyncDisposableStack.prototype.adopt( _value_, _onDisposeAsync_ )

    -

    This method performs the following steps when called:

    - - 1. Let _asyncDisposableStack_ be the *this* value. - 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 _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.prototype.defer( _onDisposeAsync_ )

    -

    This method performs the following steps when called:

    + +

    get AsyncDisposableStack.prototype.disposed

    +

    `AsyncDisposableStack.prototype.disposed` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps:

    1. Let _asyncDisposableStack_ be the *this* value. 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. Perform ? AddDisposableResource(_asyncDisposableStack_.[[DisposeCapability]], *undefined*, ~async-dispose~, _onDisposeAsync_). - 1. Return *undefined*. + 1. If _asyncDisposableStack_.[[AsyncDisposableState]] is ~disposed~, return *true*. + 1. Otherwise, return *false*.
    @@ -4778,6 +4767,18 @@ contributors: Ron Buckton, Ecma International
    + +

    AsyncDisposableStack.prototype.use( _value_ )

    +

    This method performs the following steps when called:

    + + 1. Let _asyncDisposableStack_ be the *this* value. + 1. Perform ? RequireInternalSlot(_asyncDisposableStack_, [[AsyncDisposableState]]). + 1. If _asyncDisposableStack_.[[AsyncDisposableState]] is ~disposed~, throw a *ReferenceError* exception. + 1. Perform ? AddDisposableResource(_asyncDisposableStack_.[[DisposeCapability]], _value_, ~async-dispose~). + 1. Return _value_. + +
    +

    AsyncDisposableStack.prototype [ @@asyncDispose ] ()

    The initial value of the @@asyncDispose property is %AsyncDisposableStack.prototype.disposeAsync%, defined in .