diff --git a/spec.html b/spec.html index e9105d0333..27b3f6328f 100644 --- a/spec.html +++ b/spec.html @@ -13723,13 +13723,16 @@

Built-in Function Objects

-

For a built-in function object defined in this specification, the effect of calling such a function must conform to its specification. An implementation may also provide additional built-in function objects that are not defined in this specification.

-

Built-in function objects must have the ordinary object behaviour specified in . All such function objects have [[Prototype]], [[Extensible]], [[Realm]], and [[InitialName]] internal slots. [[Realm]] has the same meaning as in . The value of the [[InitialName]] internal slot is a String value that is the initial name of the function. It is used by .

-

Unless otherwise specified every built-in function object has the %Function.prototype% object as the initial value of its [[Prototype]] internal slot.

-

The behaviour specified for each built-in function via algorithm steps or other means is the specification of the function body behaviour for both [[Call]] and [[Construct]] invocations of the function. However, [[Construct]] invocation is not supported by all built-in functions. For each built-in function, when invoked with [[Call]], the [[Call]] _thisArgument_ provides the *this* value, the [[Call]] _argumentsList_ provides the named parameters, and the NewTarget value is *undefined*. When invoked with [[Construct]], the *this* value is uninitialized, the [[Construct]] _argumentsList_ provides the named parameters, and the [[Construct]] _newTarget_ parameter provides the NewTarget value.

-

Built-in function objects that are not identified as constructors do not implement the [[Construct]] internal method unless otherwise specified in the description of a particular function. When a built-in constructor is called as part of a `new` expression the _argumentsList_ parameter of the invoked [[Construct]] internal method provides the values for the built-in constructor's named parameters.

-

Built-in functions that are not constructors do not have a *"prototype"* property unless otherwise specified in the description of a particular function.

-

A built-in function object must provide [[Call]] and [[Construct]] internal methods that conform to the following definitions:

+

A built-in function object is an ordinary object; it must satisfy the requirements for ordinary objects set out in .

+

In addition to the internal slots required of every ordinary object (see ), a built-in function object must also have the following internal slots:

+ +

The initial value of a built-in function object's [[Prototype]] internal slot is %Function.prototype%, unless otherwise specified.

+

A built-in function object must have a [[Call]] internal method that conforms to the definition in .

+

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 .

+

An implementation may provide additional built-in function objects that are not defined in this specification.

@@ -13785,6 +13788,7 @@

1. Perform any necessary implementation-defined initialization of _calleeContext_. 1. Push _calleeContext_ onto the execution context stack; _calleeContext_ is now the running execution context. 1. [id="step-call-builtin-function-result"] Let _result_ be the Completion Record that is the result of evaluating _F_ in a manner that conforms to the specification of _F_. If _thisArgument_ is ~uninitialized~, the *this* value is uninitialized; otherwise, _thisArgument_ provides the *this* value. _argumentsList_ provides the named parameters. _newTarget_ provides the NewTarget value. + 1. NOTE: If _F_ is defined in this document, “the specification of _F_” is the behaviour specified for it via algorithm steps or other means. 1. Remove _calleeContext_ from the execution context stack and restore _callerContext_ as the running execution context. 1. Return ? _result_. @@ -28652,7 +28656,9 @@

ECMAScript Standard Built-in Objects

Unless otherwise specified every built-in function and every built-in constructor has the Function prototype object, which is the initial value of the expression `Function.prototype` (), as the value of its [[Prototype]] internal slot.

Unless otherwise specified every built-in prototype object has the Object prototype object, which is the initial value of the expression `Object.prototype` (), as the value of its [[Prototype]] internal slot, except the Object prototype object itself.

+

If this specification defines a built-in constructor's behaviour via algorithm steps, then that is its behaviour for the purposes of both [[Call]] and [[Construct]]. If such an algorithm needs to distinguish the two cases, it checks whether NewTarget is *undefined*, which indicates a [[Call]] invocation.

Built-in function objects that are not identified as constructors do not implement the [[Construct]] internal method unless otherwise specified in the description of a particular function.

+

Built-in function objects that are not constructors do not have a *"prototype"* property unless otherwise specified in the description of a particular function.

Each built-in function defined in this specification is created by calling the CreateBuiltinFunction abstract operation (). The values of the _length_ and _name_ parameters are the initial values of the *"length"* and *"name"* properties as discussed below. The values of the _prefix_ parameter are similarly discussed below.

Every built-in function object, including constructors, has a *"length"* property whose value is a non-negative integral Number. Unless otherwise specified, this value is the number of required parameters shown in the subclause heading for the function description. Optional parameters and rest parameters are not included in the parameter count.