You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: spec.html
+21-42Lines changed: 21 additions & 42 deletions
Original file line number
Diff line number
Diff line change
@@ -2975,7 +2975,7 @@ <h1>Object Internal Methods and Internal Slots</h1>
2975
2975
For the internal methods listed in <emu-xref href="#table-essential-internal-methods"></emu-xref>, the object uses those defined in <emu-xref href="#sec-ordinary-object-internal-methods-and-internal-slots"></emu-xref>.
2976
2976
</li>
2977
2977
<li>
2978
-
If the object has a [[Call]] internal method, it uses the one defined in <emu-xref href="#sec-ecmascript-function-objects-call-thisargument-argumentslist"></emu-xref>, the one defined in <emu-xref href="#sec-built-in-function-objects-call-thisargument-argumentslist"></emu-xref>, or the one defined in <emu-xref href="#sec-built-in-async-function-objects-call"></emu-xref>.
2978
+
If the object has a [[Call]] internal method, it uses either the one defined in <emu-xref href="#sec-ecmascript-function-objects-call-thisargument-argumentslist"></emu-xref> or the one defined in <emu-xref href="#sec-built-in-function-objects-call-thisargument-argumentslist"></emu-xref>.
2979
2979
</li>
2980
2980
<li>
2981
2981
If the object has a [[Construct]] internal method, it uses either the one defined in <emu-xref href="#sec-ecmascript-function-objects-construct-argumentslist-newtarget"></emu-xref> or the one defined in <emu-xref href="#sec-built-in-function-objects-construct-argumentslist-newtarget"></emu-xref>.
@@ -13858,7 +13858,7 @@ <h1>Built-in Function Objects</h1>
13858
13858
<li>[[InitialName]], a String that is the initial name of the function. It is used by <emu-xref href="#sec-function.prototype.tostring"></emu-xref>.</li>
13859
13859
</ul>
13860
13860
<p>The initial value of a built-in function object's [[Prototype]] internal slot is %Function.prototype%, unless otherwise specified.</p>
13861
-
<p>A built-in function object must have a [[Call]] internal method that conforms to either the definition in <emu-xref href="#sec-built-in-function-objects-call-thisargument-argumentslist"></emu-xref> or the definition in <emu-xref href="#sec-built-in-async-function-objects-call"></emu-xref>.</p>
13861
+
<p>A built-in function object must have a [[Call]] internal method that conforms to the definition in <emu-xref href="#sec-built-in-function-objects-call-thisargument-argumentslist"></emu-xref>.</p>
13862
13862
<p>A built-in function object has a [[Construct]] internal method if and only if it is described as a “constructor”, or some algorithm in this specification explicitly sets its [[Construct]] internal method. Such a [[Construct]] internal method must conform to the definition in <emu-xref href="#sec-built-in-function-objects-construct-argumentslist-newtarget"></emu-xref>.</p>
13863
13863
<p>An implementation may provide additional built-in function objects that are not defined in this specification.</p>
1. Let _callerContext_ be the running execution context.
13879
+
1. If _callerContext_ is not already suspended, suspend _callerContext_.
13880
+
1. Let _calleeContext_ be a new execution context.
13881
+
1. Set the Function of _calleeContext_ to _F_.
13882
+
1. Let _calleeRealm_ be _F_.[[Realm]].
13883
+
1. Set the Realm of _calleeContext_ to _calleeRealm_.
13884
+
1. Set the ScriptOrModule of _calleeContext_ to *null*.
13885
+
1. Perform any necessary implementation-defined initialization of _calleeContext_.
13886
+
1. Push _calleeContext_ onto the execution context stack; _calleeContext_ is now the running execution context.
13887
+
1. Let _promiseCapability_ be ! NewPromiseCapability(%Promise%).
13888
+
1. Let _resultsClosure_ be a new Abstract Closure with no parameters that captures _F_, _thisArgument_, and _argumentsList_ and performs the following steps when called:
13889
+
1. Return the Completion Record that is <emu-meta effects="user-code">the result of evaluating</emu-meta> _F_ in a manner that conforms to the specification of _F_. _thisArgument_ provides the *this* value, _argumentsList_ provides the named parameters, and the NewTarget value is *undefined*.
1. If _prototype_ is not present, set _prototype_ to _realm_.[[Intrinsics]].[[%Function.prototype%]].
13949
13966
1. Let _internalSlotsList_ be a List containing the names of all the internal slots that <emu-xref href="#sec-built-in-function-objects"></emu-xref> requires for the built-in function object that is about to be created.
13950
13967
1. Append to _internalSlotsList_ the elements of _additionalInternalSlotsList_.
13951
-
1. If _behaviour_ is described as async, then
13952
-
1. Let _func_ be a new built-in async function object that, when called, performs the action described by _behaviour_ using the provided arguments as the values of the corresponding parameters specified by _behaviour_. The new function object has internal slots whose names are the elements of _internalSlotsList_, and an [[InitialName]] internal slot.
13953
-
1. Else,
13954
-
1. Let _func_ be a new built-in function object that, when called, performs the action described by _behaviour_ using the provided arguments as the values of the corresponding parameters specified by _behaviour_. The new function object has internal slots whose names are the elements of _internalSlotsList_, and an [[InitialName]] internal slot.
13968
+
1. Let _func_ be a new built-in function object that, when called, performs the action described by _behaviour_ using the provided arguments as the values of the corresponding parameters specified by _behaviour_. The new function object has internal slots whose names are the elements of _internalSlotsList_, and an [[InitialName]] internal slot.
<p><dfn variants="built-in async function object,built-in async function objects">Built-in async function objects</dfn> are built-in function objects that provide a [[Call]] internal method that conforms to the following definition:</p>
_argumentsList_: a List of ECMAScript language values,
13979
-
): a normal completion containing a Promise
13980
-
</h1>
13981
-
<dl class="header">
13982
-
<dt>for</dt>
13983
-
<dd>a built-in async function object _F_</dd>
13984
-
</dl>
13985
-
<emu-alg>
13986
-
1. Let _callerContext_ be the running execution context.
13987
-
1. If _callerContext_ is not already suspended, suspend _callerContext_.
13988
-
1. Let _calleeContext_ be a new execution context.
13989
-
1. Set the Function of _calleeContext_ to _F_.
13990
-
1. Let _calleeRealm_ be _F_.[[Realm]].
13991
-
1. Set the Realm of _calleeContext_ to _calleeRealm_.
13992
-
1. Set the ScriptOrModule of _calleeContext_ to *null*.
13993
-
1. Perform any necessary implementation-defined initialization of _calleeContext_.
13994
-
1. Push _calleeContext_ onto the execution context stack; _calleeContext_ is now the running execution context.
13995
-
1. Let _promiseCapability_ be ! NewPromiseCapability(%Promise%).
13996
-
1. Let _resultsClosure_ be a new Abstract Closure with no parameters that captures _F_, _thisArgument_, and _argumentsList_ and performs the following steps when called:
13997
-
1. Return the Completion Record that is <emu-meta effects="user-code">the result of evaluating</emu-meta> _F_ in a manner that conforms to the specification of _F_. _thisArgument_ provides the *this* value, _argumentsList_ provides the named parameters, and the NewTarget value is *undefined*.
<h1>Built-in Exotic Object Internal Methods and Slots</h1>
14007
13986
<p>This specification defines several kinds of built-in exotic objects. These objects generally behave similar to ordinary objects except for a few specific situations. The following exotic objects use the ordinary object internal methods except where it is explicitly specified otherwise below:</p>
0 commit comments