From 1e265b9e01f02d729065ffdb6d047cd2c98363c7 Mon Sep 17 00:00:00 2001 From: ExE Boss <3889017+ExE-Boss@users.noreply.github.com> Date: Wed, 22 Jul 2020 01:30:00 +0200 Subject: [PATCH] =?UTF-8?q?Editorial:=20Add=C2=A0support=20for=C2=A0Abstra?= =?UTF-8?q?ct=C2=A0Closures=20to=C2=A0`CreateBuiltinFunction`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Kevin Gibbons Co-authored-by: Michael Dyck --- spec.html | 31 ++++++++++--------------------- 1 file changed, 10 insertions(+), 21 deletions(-) diff --git a/spec.html b/spec.html index 2785c37ae29..4cd72c0baa9 100644 --- a/spec.html +++ b/spec.html @@ -11151,14 +11151,14 @@

[[Construct]] ( _argumentsList_, _newTarget_ )

-

CreateBuiltinFunction ( _steps_, _length_, _name_, _internalSlotsList_ [ , _realm_ [ , _prototype_ [ , _prefix_ ] ] ] )

-

The abstract operation CreateBuiltinFunction takes arguments _steps_, _length_, _name_, and _internalSlotsList_ (a List of names of internal slots) and optional arguments _realm_, _prototype_, and _prefix_. _internalSlotsList_ contains the names of additional internal slots that must be defined as part of the object. This operation creates a built-in function object. It performs the following steps when called:

+

CreateBuiltinFunction ( _algorithm_, _length_, _name_, _internalSlotsList_ [ , _realm_ [ , _prototype_ [ , _prefix_ ] ] ] )

+

The abstract operation CreateBuiltinFunction takes arguments _algorithm_, _length_ (a non-negative integer or +∞), _name_, and _internalSlotsList_ (a List of names of internal slots) and optional arguments _realm_, _prototype_, and _prefix_. _internalSlotsList_ contains the names of additional internal slots that must be defined as part of the object. This operation creates a built-in function object. It performs the following steps when called:

- 1. Assert: _steps_ is either a set of algorithm steps or other definition of a function's behaviour provided in this specification. + 1. Assert: _algorithm_ is either an Abstract Closure, a set of algorithm steps, or some other definition of a function's behaviour provided in this specification. 1. If _realm_ is not present, set _realm_ to the current Realm Record. 1. Assert: _realm_ is a Realm Record. 1. If _prototype_ is not present, set _prototype_ to _realm_.[[Intrinsics]].[[%Function.prototype%]]. - 1. Let _func_ be a new built-in function object that when called performs the action described by _steps_. The new function object has internal slots whose names are the elements of _internalSlotsList_, and an [[InitialName]] internal slot. + 1. Let _func_ be a new built-in function object that when called performs the action described by _algorithm_. The new function object has internal slots whose names are the elements of _internalSlotsList_, and an [[InitialName]] internal slot. 1. Set _func_.[[Realm]] to _realm_. 1. Set _func_.[[Prototype]] to _prototype_. 1. Set _func_.[[Extensible]] to *true*. @@ -24628,34 +24628,23 @@

Object.freeze ( _O_ )

- +

Object.fromEntries ( _iterable_ )

When the `fromEntries` method is called with argument _iterable_, the following steps are taken:

1. Perform ? RequireObjectCoercible(_iterable_). 1. Let _obj_ be ! OrdinaryObjectCreate(%Object.prototype%). 1. Assert: _obj_ is an extensible ordinary object with no own properties. - 1. Let _stepsDefine_ be the algorithm steps defined in . - 1. Let _lengthDefine_ be the number of non-optional parameters of the function definition in . - 1. Let _adder_ be ! CreateBuiltinFunction(_stepsDefine_, _lengthDefine_, *""*, « »). + 1. Let _closure_ be a new Abstract Closure with parameters (_key_, _value_) that captures _obj_ and performs the following steps when called: + 1. Let _propertyKey_ be ? ToPropertyKey(_key_). + 1. Perform ! CreateDataPropertyOrThrow(_obj_, _propertyKey_, _value_). + 1. Return *undefined*. + 1. Let _adder_ be ! CreateBuiltinFunction(_closure_, 2, *""*, « »). 1. Return ? AddEntriesFromIterable(_obj_, _iterable_, _adder_). The function created for _adder_ is never directly accessible to ECMAScript code. - - -

CreateDataPropertyOnObject Functions

-

A CreateDataPropertyOnObject function is an anonymous built-in function. When a CreateDataPropertyOnObject function is called with arguments _key_ and _value_, the following steps are taken:

- - 1. Let _O_ be the *this* value. - 1. Assert: Type(_O_) is Object. - 1. Assert: _O_ is an extensible ordinary object. - 1. Let _propertyKey_ be ? ToPropertyKey(_key_). - 1. Perform ! CreateDataPropertyOrThrow(_O_, _propertyKey_, _value_). - 1. Return *undefined*. - -