diff --git a/index.bs b/index.bs index 72fe5c47..bd2bbdf9 100644 --- a/index.bs +++ b/index.bs @@ -8064,7 +8064,7 @@ IDL [=promise type=] values are represented by ECMAScript [=PromiseCapability=] the result of performing them, given |value| if |T| is not {{undefined}}. Otherwise, let |result| be |value|. 1. Return |result|, [=converted to an ECMAScript value=]. - 1. Let |onFulfilled| be [$CreateBuiltinFunction$](|onFulfilledSteps|, « »): + 1. Let |onFulfilled| be [$CreateBuiltinFunction$](|onFulfilledSteps|, 1, "", « »): 1. Let |onRejectedSteps| be the following steps given argument |R|: 1. Let |reason| be the result of [=converted to an IDL value|converting=] |R| to an IDL value of type {{any}}. @@ -8072,7 +8072,7 @@ IDL [=promise type=] values are represented by ECMAScript [=PromiseCapability=] the result of performing them, given |reason|. Otherwise, let |result| be [=a promise rejected with=] |reason|. 1. Return |result|, [=converted to an ECMAScript value=]. - 1. Let |onRejected| be [$CreateBuiltinFunction$](|onRejectedSteps|, « »): + 1. Let |onRejected| be [$CreateBuiltinFunction$](|onRejectedSteps|, 1, "", « »): 1. Let |constructor| be |promise|.\[[Promise]].\[[Realm]].\[[Intrinsics]].[[{{%Promise%}}]]. 1. Let |newCapability| be [=?=] [$NewPromiseCapability$](|constructor|). @@ -8123,7 +8123,7 @@ IDL [=promise type=] values are represented by ECMAScript [=PromiseCapability=] 1. If |rejected| is true, abort these steps. 1. Set |rejected| to true. 1. Perform |failureSteps| given |arg|. - 1. Let |rejectionHandler| be [$CreateBuiltinFunction$](|rejectionHandlerSteps|, « »): + 1. Let |rejectionHandler| be [$CreateBuiltinFunction$](|rejectionHandlerSteps|, 1, "", « »): 1. Let |total| be |promises|'s [=list/size=]. 1. If |total| is 0, then: 1. [=Queue a microtask=] to perform |successSteps| given « ». @@ -8136,7 +8136,7 @@ IDL [=promise type=] values are represented by ECMAScript [=PromiseCapability=] 1. Set |result|[|promiseIndex|] to |arg|. 1. Set |fullfilledCount| to |fullfilledCount| + 1. 1. If |fullfilledCount| equals |total|, then perform |successSteps| given |result|. - 1. Let |fulfillmentHandler| be [$CreateBuiltinFunction$](|fulfillmentHandler|, « »): + 1. Let |fulfillmentHandler| be [$CreateBuiltinFunction$](|fulfillmentHandler|, 1, "", « »): 1. Perform [$PerformPromiseThen$](|promise|, |fulfillmentHandler|, |rejectionHandler|). 1. Set |index| to |index| + 1. @@ -11215,7 +11215,13 @@ default interfaces do not have such steps. 1. Let |constructorProto| be |realm|.\[[Intrinsics]].[[{{%Function.prototype%}}]]. 1. If |I| inherits from some other interface |P|, then set |constructorProto| to the [=interface object=] of |P| in |realm|. - 1. Let |F| be CreateBuiltinFunction(|steps|, « \[[Unforgeables]] », + 1. Let |length| be 0. + 1. If |I| was declared with a [=constructor operation=], then + 1. [=Compute the effective overload set=] for constructors with [=identifier=] |id| on + [=interface=] |I| and with argument count 0, and let |S| be the result. + 1. Set |length| to the length of the + shortest argument list of the entries in |S|. + 1. Let |F| be [$CreateBuiltinFunction$](|steps|, |length|, |id|, « \[[Unforgeables]] », |realm|, |constructorProto|). 1. Let |unforgeables| be [$OrdinaryObjectCreate$](null). 1. [=Define the unforgeable regular operations=] of |I| on |unforgeables|, given |realm|. @@ -11226,14 +11232,6 @@ default interfaces do not have such steps. of an interface with an unforgeable member use the same JavaScript function objects for [=attribute getters=], [=attribute setters=] and [=creating an operation function|operation functions=]. - 1. Perform SetFunctionName(|F|, |id|). - 1. Let |length| be 0. - 1. If |I| was declared with a [=constructor operation=], then - 1. [=Compute the effective overload set=] for constructors with [=identifier=] |id| on - [=interface=] |I| and with argument count 0, and let |S| be the result. - 1. Set |length| to the length of the - shortest argument list of the entries in |S|. - 1. Perform SetFunctionLength(|F|, |length|). 1. Let |proto| be the result of [=create an interface prototype object|creating an interface prototype object=] of [=interface=] |I| in |realm|. 1. Perform [=!=] DefinePropertyOrThrow(|F|, "prototype", @@ -11279,12 +11277,10 @@ implement the interface on which the 1. Assert: |O| is an object that [=implements=] |I|. 1. Assert: |O|.\[[Realm]] is |realm|. 1. Return |O|. - 1. Let |F| be CreateBuiltinFunction(|steps|, « », |realm|). - 1. Perform SetFunctionName(|F|, |id|). 1. [=Compute the effective overload set=] for legacy factory functions with [=identifier=] |id| on [=interface=] |I| and with argument count 0, and let |S| be the result. 1. Let |length| be the length of the shortest argument list of the entries in |S|. - 1. Perform SetFunctionLength(|F|, |length|). + 1. Let |F| be [$CreateBuiltinFunction$](|steps|, |length|, |id|, « », |realm|). 1. Let |proto| be the [=interface prototype object=] of [=interface=] |I| in |realm|. 1. Perform [=!=] DefinePropertyOrThrow(|F|, "prototype", PropertyDescriptor{\[[Value]]: |proto|, \[[Writable]]: false, \[[Enumerable]]: false, \[[Configurable]]: false}). @@ -11637,11 +11633,8 @@ in which case they are exposed on every object that [=implements=] the interface 1. If |attribute|'s type is a [=promise type=], then return [=!=] Call({{%Promise.reject%}}, {{%Promise%}}, «|E|»). 1. Otherwise, end these steps and allow the exception to propagate. - 1. Let |F| be CreateBuiltinFunction(|steps|, « », |realm|). - 1. Let |name| be the string "get " prepended to |attribute|'s [=identifier=]. - 1. Perform SetFunctionName(|F|, |name|). - 1. Perform SetFunctionLength(|F|, 0). - 1. Return |F|. + 1. Let |name| be |attribute|'s [=identifier=]. + 1. Return [$CreateBuiltinFunction$](|steps|, 0, |name|, « », |realm|, |realm|.\[[Intrinsics]].\[[{{%Function.prototype%}}]], "get"). @@ -11723,11 +11716,8 @@ in which case they are exposed on every object that [=implements=] the interface 1. Perform the [=setter steps=] of |attribute|, with |idlObject| as [=this=] and |idlValue| as [=the given value=]. 1. Return undefined - 1. Let |F| be CreateBuiltinFunction(|steps|, « », |realm|). - 1. Let |name| be the string "set " prepended to |id|. - 1. Perform SetFunctionName(|F|, |name|). - 1. Perform SetFunctionLength(|F|, 1). - 1. Return |F|. + 1. Let |name| be |attribute|'s [=identifier=]. + 1. Return be [$CreateBuiltinFunction$](|steps|, 1, |name|, « », |realm|, |realm|.\[[Intrinsics]].\[[{{%Function.prototype%}}]], "set"). Note: Although there is only a single property for an IDL attribute, since @@ -11841,14 +11831,11 @@ in which case they are exposed on every object that [=implements=] the interface that is a [=promise type=], then return [=!=] Call({{%Promise.reject%}}, {{%Promise%}}, «|E|»). 1. Otherwise, end these steps and allow the exception to propagate. - 1. Let |F| be CreateBuiltinFunction(|steps|, « », |realm|). - 1. Perform SetFunctionName(|F|, |id|). 1. [=Compute the effective overload set=] for [=regular operations=] (if |op| is a regular operation) or for [=static operations=] (if |op| is a static operation) with [=identifier=] |id| on |target| and with argument count 0, and let |S| be the result. 1. Let |length| be the length of the shortest argument list in the entries in |S|. - 1. Perform SetFunctionLength(|F|, |length|). - 1. Return |F|. + 1. Return [$CreateBuiltinFunction$](|steps|, |length|, |id|, « », |realm|). @@ -12084,9 +12071,7 @@ then there must exist a property with the following characteristics: |esValue| as its [=default iterator object/target=], "key+value" as its [=default iterator object/kind=], and [=default iterator object/index=] set to 0. - 1. Let |F| be [$CreateBuiltinFunction$](|steps|, « », |realm|). - 1. Perform [$SetFunctionName$](|F|, "entries"). - 1. Perform [$SetFunctionLength$](|F|, 0). + 1. Let |F| be [$CreateBuiltinFunction$](|steps|, 0, "entries", « », |realm|). 1. Perform [$CreateMethodProperty$](|target|, {{@@iterator}}, |F|). 1. Perform [=!=] [$CreateDataProperty$](|target|, "entries", |F|). 1. Define the keys method: @@ -12099,9 +12084,7 @@ then there must exist a property with the following characteristics: 1. Return a newly created [=default iterator object=] for |definition|, with |esValue| as its [=default iterator object/target=], "key" as its [=default iterator object/kind=], and [=default iterator object/index=] set to 0. - 1. Let |F| be [$CreateBuiltinFunction$](|steps|, « », |realm|). - 1. Perform [$SetFunctionName$](|F|, "keys"). - 1. Perform [$SetFunctionLength$](|F|, 0). + 1. Let |F| be [$CreateBuiltinFunction$](|steps|, 0, "keys", « », |realm|). 1. Perform [=!=] [$CreateDataProperty$](|target|, "keys", |F|). 1. Define the values method: 1. Let |steps| be the following series of steps: @@ -12113,9 +12096,7 @@ then there must exist a property with the following characteristics: 1. Return a newly created [=default iterator object=] for |definition|, with |esValue| as its [=default iterator object/target=], "value" as its [=default iterator object/kind=], and [=default iterator object/index=] set to 0. - 1. Let |F| be [$CreateBuiltinFunction$](|steps|, « », |realm|). - 1. Perform [$SetFunctionName$](|F|, "values"). - 1. Perform [$SetFunctionLength$](|F|, 0). + 1. Let |F| be [$CreateBuiltinFunction$](|steps|, 0, "values", « », |realm|). 1. Perform [=!=] [$CreateDataProperty$](|target|, "values", |F|). 1. Define the forEach method: 1. Let |steps| be the following series of steps, given function argument values @@ -12139,9 +12120,7 @@ then there must exist a property with the following characteristics: 1. Set |pairs| to |idlObject|'s current list of [=value pairs to iterate over=]. (It might have changed.) 1. Set |i| to |i| + 1. - 1. Let |F| be [$CreateBuiltinFunction$](|steps|, « », |realm|). - 1. Perform [$SetFunctionName$](|F|, "forEach"). - 1. Perform [$SetFunctionLength$](|F|, 1). + 1. Let |F| be [$CreateBuiltinFunction$](|steps|, 1, "forEach", « », |realm|). 1. Perform [=!=] [$CreateDataProperty$](|target|, "forEach", |F|). @@ -12276,9 +12255,7 @@ and the string " Iterator". 1. Run the [=asynchronous iterator initialization steps=] for |definition| with |idlObject|, |iterator|, and |idlArgs|, if any such steps exist. 1. Return |iterator|. - 1. Let |F| be [$CreateBuiltinFunction$](|steps|, « », |realm|). - 1. Perform [$SetFunctionName$](|F|, "entries"). - 1. Perform [$SetFunctionLength$](|F|, 0). + 1. Let |F| be [$CreateBuiltinFunction$](|steps|, 0, "entries", « », |realm|). 1. Perform [$CreateMethodProperty$](|target|, {{@@asyncIterator}}, |F|). 1. Perform [=!=] [$CreateDataProperty$](|target|, "entries", |F|). 1. If |definition| has a [=pair asynchronously iterable declaration=], then define the @@ -12301,9 +12278,7 @@ and the string " Iterator". 1. Run the [=asynchronous iterator initialization steps=] for |definition| with |idlObject|, |iterator|, and |idlArgs|, if any such steps exist. 1. Return |iterator|. - 1. Let |F| be [$CreateBuiltinFunction$](|steps|, « », |realm|). - 1. Perform [$SetFunctionName$](|F|, "keys"). - 1. Perform [$SetFunctionLength$](|F|, 0). + 1. Let |F| be [$CreateBuiltinFunction$](|steps|, 0, "keys", « », |realm|). 1. Perform [=!=] [$CreateDataProperty$](|target|, "keys", |F|). 1. Define the values, and possibly {{@@asyncIterator}}, methods: 1. Let |steps| be the following series of steps, given function argument values |args|: @@ -12324,9 +12299,7 @@ and the string " Iterator". 1. Run the [=asynchronous iterator initialization steps=] for |definition| with |idlObject|, |iterator|, and |idlArgs|, if any such steps exist. 1. Return |iterator|. - 1. Let |F| be [$CreateBuiltinFunction$](|steps|, « », |realm|). - 1. Perform [$SetFunctionName$](|F|, "values"). - 1. Perform [$SetFunctionLength$](|F|, 0). + 1. Let |F| be [$CreateBuiltinFunction$](|steps|, 0, "values", « », |realm|). 1. Perform [=!=] [$CreateDataProperty$](|target|, "values", |F|). 1. If |definition| has a [=value asynchronously iterable declaration=], then perform [=!=] [$CreateMethodProperty$](|target|, {{@@asyncIterator}}, |F|). @@ -12452,13 +12425,13 @@ The \[[Prototype]] [=/internal slot=] of an [=asynchronous iterator prototype ob 1. Assert: |next| is a value of the type that appears in the declaration. 1. Let |value| be |next|, [=converted to an ECMAScript value=]. 1. Return [$CreateIterResultObject$](|value|, false). - 1. Let |onFulfilled| be [$CreateBuiltinFunction$](|fulfillSteps|, « »). + 1. Let |onFulfilled| be [$CreateBuiltinFunction$](|fulfillSteps|, 1, "", « »). 1. Let |rejectSteps| be the following steps, given |reason|: 1. Set |object|'s [=default asynchronous iterator object/ongoing promise=] to null. 1. Set |object|'s [=default asynchronous iterator object/is finished=] to true. 1. [=ECMAScript/Throw=] |reason|. - 1. Let |onRejected| be [$CreateBuiltinFunction$](|rejectSteps|, « »). + 1. Let |onRejected| be [$CreateBuiltinFunction$](|rejectSteps|, 1, "", « »). 1. Perform [$PerformPromiseThen$](|nextPromise|, |onFulfilled|, |onRejected|, |nextPromiseCapability|). 1. Return |nextPromiseCapability|.\[[Promise]]. @@ -12467,7 +12440,7 @@ The \[[Prototype]] [=/internal slot=] of an [=asynchronous iterator prototype ob 1. If |ongoingPromise| is not null, then: 1. Let |afterOngoingPromiseCapability| be [=!=] [$NewPromiseCapability$]({{%Promise%}}). - 1. Let |onSettled| be [$CreateBuiltinFunction$](|nextSteps|, « »). + 1. Let |onSettled| be [$CreateBuiltinFunction$](|nextSteps|, 0, "", « »). 1. Perform [$PerformPromiseThen$](|ongoingPromise|, |onSettled|, |onSettled|, |afterOngoingPromiseCapability|). 1. Set |object|'s [=default asynchronous iterator object/ongoing promise=] to @@ -12533,7 +12506,7 @@ The \[[Prototype]] [=/internal slot=] of an [=asynchronous iterator prototype ob 1. If |ongoingPromise| is not null, then: 1. Let |afterOngoingPromiseCapability| be [=!=] [$NewPromiseCapability$]({{%Promise%}}). - 1. Let |onSettled| be [$CreateBuiltinFunction$](|returnSteps|, « »). + 1. Let |onSettled| be [$CreateBuiltinFunction$](|returnSteps|, 0, "", « »). 1. Perform [$PerformPromiseThen$](|ongoingPromise|, |onSettled|, |onSettled|, |afterOngoingPromiseCapability|). 1. Set |returnStepsPromise| to |afterOngoingPromiseCapability|.\[[Promise]]. @@ -12544,7 +12517,7 @@ The \[[Prototype]] [=/internal slot=] of an [=asynchronous iterator prototype ob 1. Let |fulfillSteps| be the following steps: 1. Return [$CreateIterResultObject$](|value|, true). - 1. Let |onFulfilled| be [$CreateBuiltinFunction$](|fulfillSteps|, « »). + 1. Let |onFulfilled| be [$CreateBuiltinFunction$](|fulfillSteps|, 0, "", « »). 1. Perform [$PerformPromiseThen$](|returnStepsPromise|, |onFulfilled|, undefined, |returnPromiseCapability|). @@ -13710,21 +13683,21 @@ those of normal Array instances: 1. Set |handler|.\[[Type]] to |T|. 1. Set |handler|.\[[SetAlgorithm]] to |setAlgorithm|. 1. Set |handler|.\[[DeleteAlgorithm]] to |deleteAlgorithm|. - 1. Let |defineProperty| be [$CreateBuiltinFunction$](the steps from [[#es-observable-array-defineProperty]], « », |realm|). + 1. Let |defineProperty| be [$CreateBuiltinFunction$](the steps from [[#es-observable-array-defineProperty]], the number of non-optional parameters from [[#es-observable-array-defineProperty]], "defineProperty", « », |realm|). 1. Perform [=!=] [$CreateDataProperty$](|handler|, "defineProperty", |defineProperty|). - 1. Let |deleteProperty| be [$CreateBuiltinFunction$](the steps from [[#es-observable-array-deleteProperty]], « », |realm|). + 1. Let |deleteProperty| be [$CreateBuiltinFunction$](the steps from [[#es-observable-array-deleteProperty]], the number of non-optional parameters from [[#es-observable-array-deleteProperty]], "deleteProperty", « », |realm|). 1. Perform [=!=] [$CreateDataProperty$](|handler|, "deleteProperty", |deleteProperty|). - 1. Let |get| be [$CreateBuiltinFunction$](the steps from [[#es-observable-array-get]], « », |realm|). + 1. Let |get| be [$CreateBuiltinFunction$](the steps from [[#es-observable-array-get]], the number of non-optional parameters from [[#es-observable-array-get]], "get", « », |realm|). 1. Perform [=!=] [$CreateDataProperty$](|handler|, "get", |get|). - 1. Let |getOwnPropertyDescriptor| be [$CreateBuiltinFunction$](the steps from [[#es-observable-array-getOwnPropertyDescriptor]], « », |realm|). + 1. Let |getOwnPropertyDescriptor| be [$CreateBuiltinFunction$](the steps from [[#es-observable-array-getOwnPropertyDescriptor]], the number of non-optional parameters from [[#es-observable-array-getOwnPropertyDescriptor]], "getOwnPropertyDescriptor", « », |realm|). 1. Perform [=!=] [$CreateDataProperty$](|handler|, "getOwnPropertyDescriptor", |getOwnPropertyDescriptor|). - 1. Let |has| be [$CreateBuiltinFunction$](the steps from [[#es-observable-array-has]], « », |realm|). + 1. Let |has| be [$CreateBuiltinFunction$](the steps from [[#es-observable-array-has]], the number of non-optional parameters from [[#es-observable-array-has]], "has", « », |realm|). 1. Perform [=!=] [$CreateDataProperty$](|handler|, "has", |has|). - 1. Let |ownKeys| be [$CreateBuiltinFunction$](the steps from [[#es-observable-array-ownKeys]], « », |realm|). + 1. Let |ownKeys| be [$CreateBuiltinFunction$](the steps from [[#es-observable-array-ownKeys]], the number of non-optional parameters from [[#es-observable-array-ownKeys]], "ownKeys", « », |realm|). 1. Perform [=!=] [$CreateDataProperty$](|handler|, "ownKeys", |ownKeys|). - 1. Let |preventExtensions| be [$CreateBuiltinFunction$](the steps from [[#es-observable-array-preventExtensions]], « », |realm|). + 1. Let |preventExtensions| be [=!=] [$CreateBuiltinFunction$](the steps from [[#es-observable-array-preventExtensions]], the number of non-optional parameters from [[#es-observable-array-preventExtensions]], "preventExtensions", « », |realm|). 1. Perform [=!=] [$CreateDataProperty$](|handler|, "preventExtensions", |preventExtensions|). - 1. Let |set| be [$CreateBuiltinFunction$](the steps from [[#es-observable-array-set]], « », |realm|). + 1. Let |set| be [$CreateBuiltinFunction$](the steps from [[#es-observable-array-set]], the number of non-optional parameters from [[#es-observable-array-set]], "set", « », |realm|). 1. Perform [=!=] [$CreateDataProperty$](|handler|, "set", |set|). 1. Return [=!=] [$ProxyCreate$](|innerArray|, |handler|). @@ -14047,9 +14020,7 @@ when applied to a [=legacy callback interface object=]. 1. Let |steps| be the following steps: 1. [=ECMAScript/Throw=] a {{TypeError}}}. - 1. Let |F| be CreateBuiltinFunction(|steps|, « », |realm|). - 1. Perform SetFunctionName(|F|, |id|). - 1. Perform SetFunctionLength(|F|, 0). + 1. Let |F| be [$CreateBuiltinFunction$](|steps|, 0, |id|, « », |realm|). 1. [=Define the constants=] of |interface| on |F| given |realm|. 1. Return |F|.