Skip to content

Commit

Permalink
Normative: Use onFinally's realm when creating functions in Promise.p…
Browse files Browse the repository at this point in the history
…rototype.finally (fixes tc39#2222)
  • Loading branch information
arai-a committed Nov 24, 2020
1 parent 889f2f3 commit b54a7a3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -40302,12 +40302,13 @@ <h1>Promise.prototype.finally ( _onFinally_ )</h1>
1. Let _thenFinally_ be _onFinally_.
1. Let _catchFinally_ be _onFinally_.
1. Else,
1. Let _realm_ be ? GetFunctionRealm(_onFinally_).
1. Let _stepsThenFinally_ be the algorithm steps defined in <emu-xref href="#sec-thenfinallyfunctions" title></emu-xref>.
1. Let _thenFinally_ be ! CreateBuiltinFunction(_stepsThenFinally_, &laquo; [[Constructor]], [[OnFinally]] &raquo;).
1. Let _thenFinally_ be ! CreateBuiltinFunction(_stepsThenFinally_, &laquo; [[Constructor]], [[OnFinally]] &raquo;, _realm_).
1. Set _thenFinally_.[[Constructor]] to _C_.
1. Set _thenFinally_.[[OnFinally]] to _onFinally_.
1. Let _stepsCatchFinally_ be the algorithm steps defined in <emu-xref href="#sec-catchfinallyfunctions" title></emu-xref>.
1. Let _catchFinally_ be ! CreateBuiltinFunction(_stepsCatchFinally_, &laquo; [[Constructor]], [[OnFinally]] &raquo;).
1. Let _catchFinally_ be ! CreateBuiltinFunction(_stepsCatchFinally_, &laquo; [[Constructor]], [[OnFinally]] &raquo;, _realm_).
1. Set _catchFinally_.[[Constructor]] to _C_.
1. Set _catchFinally_.[[OnFinally]] to _onFinally_.
1. Return ? Invoke(_promise_, *"then"*, &laquo; _thenFinally_, _catchFinally_ &raquo;).
Expand Down

0 comments on commit b54a7a3

Please sign in to comment.