From 314549b1437f9e2c1994938aae1cc0cbffc09e2f Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Tue, 30 Jan 2018 15:38:57 -0800 Subject: [PATCH] Normative: add explicit "length" property info for ThenFinally/CatchFinally (#1083) Fixes #1078 --- spec.html | 46 ++++++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/spec.html b/spec.html index c1419053ee..efce5daff1 100644 --- a/spec.html +++ b/spec.html @@ -37657,17 +37657,17 @@

Promise.prototype.finally ( _onFinally_ )

1. Let _thenFinally_ be _onFinally_. 1. Let _catchFinally_ be _onFinally_. 1. Else, - 1. Let _thenFinally_ be a new built-in function object as defined in ThenFinally Function. - 1. Let _catchFinally_ be a new built-in function object as defined in CatchFinally Function. + 1. Let _thenFinally_ be a new built-in function object as defined in . + 1. Let _catchFinally_ be a new built-in function object as defined in . 1. Set _thenFinally_ and _catchFinally_'s [[Constructor]] internal slots to _C_. 1. Set _thenFinally_ and _catchFinally_'s [[OnFinally]] internal slots to _onFinally_. 1. Return ? Invoke(_promise_, `"then"`, « _thenFinally_, _catchFinally_ »). - -

ThenFinally Function

-

A ThenFinally function is an anonymous built-in function that has a [[Constructor]] and an [[OnFinally]] internal slot. The value of the [[Constructor]] internal slot is a `Promise`-like constructor function object, and the value of the [[OnFinally]] internal slot is a function object.

-

When a ThenFinally function _F_ is called with argument _value_, the following steps are taken:

+ +

Then Finally Functions

+

A Then Finally function is an anonymous built-in function that has a [[Constructor]] and an [[OnFinally]] internal slot. The value of the [[Constructor]] internal slot is a `Promise`-like constructor function object, and the value of the [[OnFinally]] internal slot is a function object.

+

When a Then Finally function _F_ is called with argument _value_, the following steps are taken:

1. Let _onFinally_ be _F_.[[OnFinally]]. 1. Assert: IsCallable(_onFinally_) is *true*. @@ -37678,24 +37678,26 @@

ThenFinally Function

1. Let _valueThunk_ be equivalent to a function that returns _value_. 1. Return ? Invoke(_promise_, `"then"`, « _valueThunk_ »).
-
+

The `length` property of a Then Finally function is *1*.

+
- -

CatchFinally Function

-

A CatchFinally function is an anonymous built-in function that has a [[Constructor]] and an [[OnFinally]] internal slot. The value of the [[Constructor]] internal slot is a `Promise`-like constructor function object, and the value of the [[OnFinally]] internal slot is a function object.

-

When a CatchFinally function _F_ is called with argument _reason_, the following steps are taken:

- - 1. Let _onFinally_ be _F_.[[OnFinally]]. - 1. Assert: IsCallable(_onFinally_) is *true*. - 1. Let _result_ be ? Call(_onFinally_, *undefined*). - 1. Let _C_ be _F_.[[Constructor]]. - 1. Assert: IsConstructor(_C_) is *true*. - 1. Let _promise_ be ? PromiseResolve(_C_, _result_). - 1. Let _thrower_ be equivalent to a function that throws _reason_. - 1. Return ? Invoke(_promise_, `"then"`, « _thrower_ »). - + +

Catch Finally Functions

+

A Catch Finally function is an anonymous built-in function that has a [[Constructor]] and an [[OnFinally]] internal slot. The value of the [[Constructor]] internal slot is a `Promise`-like constructor function object, and the value of the [[OnFinally]] internal slot is a function object.

+

When a Catch Finally function _F_ is called with argument _reason_, the following steps are taken:

+ + 1. Let _onFinally_ be _F_.[[OnFinally]]. + 1. Assert: IsCallable(_onFinally_) is *true*. + 1. Let _result_ be ? Call(_onFinally_, *undefined*). + 1. Let _C_ be _F_.[[Constructor]]. + 1. Assert: IsConstructor(_C_) is *true*. + 1. Let _promise_ be ? PromiseResolve(_C_, _result_). + 1. Let _thrower_ be equivalent to a function that throws _reason_. + 1. Return ? Invoke(_promise_, `"then"`, « _thrower_ »). + +

The `length` property of a Catch Finally function is *1*.

+
-