diff --git a/spec.html b/spec.html index d550baa3abf..4174c6cf3aa 100644 --- a/spec.html +++ b/spec.html @@ -28593,22 +28593,22 @@

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.

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.

-

Each built-in function defined in this specification is created by calling CreateBuiltinFunction. 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.

+

Each built-in function defined in this specification is created by calling CreateBuiltinFunction. The value of the _length_ parameter is the initial value of the *"length"* property as discussed below. The value of the _name_ and _prefix_ parameters 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 equal to 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.

For example, the function object that is the initial value of the *"map"* property of the Array prototype object is described under the subclause heading «Array.prototype.map (callbackFn [ , thisArg])» which shows the two named arguments callbackFn and thisArg, the latter being optional; therefore the value of the *"length"* property of that function object is *1*𝔽.

Unless otherwise specified, the *"length"* property of a built-in function object has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.

-

Every built-in function object, including constructors, has a *"name"* property whose value is a String. The value may be explicitly specified, as for each built-in function associated with a property whose property key is a Symbol value (for example, Function.prototype [ @@hasInstance ]). Where not explicitly specified, the value is implicitly determined by the section in which the function is defined (i.e., where its behaviour is specified). If that section specifies the function as anonymous, the value of its *"name"* property is the empty String. Otherwise, that section specifies the function as the [[Value]], [[Get]], or [[Set]] attribute of a particular property of either the global object or some other built-in object, and the value of its *"name"* property is the property name of that property.

- -

Some built-in function objects are defined in one section and referenced in one or more other sections specifying their reuse as the value of another property, and for such functions the value of the *"name"* property is determined by the section defining their behaviour. For example, the value of the *"name"* property of %Object% is *"Object"* despite use of that function object as the value for both `Object` and `Object.prototype.constructor` ().

-
-

When calling CreateBuiltinFunction to create a built-in function object, the values passed to the _name_ and _prefix_ parameters are derived from its *"name"* property as defined above and its disposition according to the following rules:

+

Every built-in function object, including constructors, has a *"name"* property whose value is a String set by CreateBuiltinFunction using the _name_ and _prefix_ parameters. The value of its *"name"* property may be explicitly specified, as for each built-in function associated with a property whose property key is a Symbol value (for example, Function.prototype [ @@hasInstance ]). Where not explicitly specified, the value of a function's *"name"* property is implicitly determined by the section in which the function is defined (i.e., where its behaviour is specified). When calling CreateBuiltinFunction to create a built-in function object, the values passed to the _name_ and _prefix_ parameters are derived from that section according to the following rules:

    -
  1. If the value of the *"name"* property is explicitly specified and that value starts with the prefix *"get "* or *"set "* and the function is a get accessor function or set accessor function, the part of that value following the prefix is passed to the _name_ parameter and *"get"* or *"set"* (respectively) is passed to the _prefix_ parameter.
  2. -
  3. Otherwise, if the value of the *"name"* property is not explicitly specified and function is a get accessor function or set accessor function, the value of the *"name"* property is passed to the _name_ parameter and *"get"* or *"set"* (respectively) is passed to the _prefix_ parameter.
  4. -
  5. Otherwise, the value of the *"name"* property is passed to the _name_ parameter and the empty String is passed to the _prefix_ parameter.
  6. +
  7. If the value of the *"name"* property is explicitly specified and that value starts with the space-terminated prefix *"get "* or *"set "* and the function is a get accessor function or set accessor function, the part of that value following the prefix is passed to the _name_ parameter and *"get"* or *"set"* (respectively) is passed to the _prefix_ parameter.
  8. +
  9. Otherwise, if the value of the *"name"* property is explicitly specified, the value of the *"name"* property is passed to the _name_ parameter and the empty String is passed to the _prefix_ parameter.
  10. +
  11. Otherwise, if the the function is specified as anonymous, the empty String is passed to the _name_ parameter and the empty String is passed to the _prefix_ parameter.
  12. +
  13. Otherwise, the section specifies the function as the [[Value]], [[Get]], or [[Set]] attribute of a particular property of either the global object or some other built-in object. The property name of that property is passed to the _name_ parameter. If the function is a get accessor function or set accessor function, *"get"* or *"set"* (respectively) is passed to the _prefix_ parameter; otherwise the empty String is passed to the _prefix_ parameter.
+ +

Some built-in function objects are defined in one section and referenced in one or more other sections specifying their reuse as the value of another property, and for such functions the values passed to CreateBuiltinFunction are determined by the section defining their behaviour. For example, the value of the *"name"* property of %Object% is *"Object"* despite use of that function object as the value for both `Object` and `Object.prototype.constructor` ().

+

Unless otherwise specified, the *"name"* property of a built-in function object has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.

Every other data property described in clauses through and in Annex has the attributes { [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *true* } unless otherwise specified.

Every accessor property described in clauses through and in Annex has the attributes { [[Enumerable]]: *false*, [[Configurable]]: *true* } unless otherwise specified. If only a get accessor function is described, the set accessor function is the default value, *undefined*. If only a set accessor is described the get accessor is the default value, *undefined*.