diff --git a/spec.html b/spec.html index 458ef5985a..a3396673a6 100644 --- a/spec.html +++ b/spec.html @@ -2739,10 +2739,11 @@

The Object Type

The properties of an object are uniquely identified using property keys. A property key is either a String or a Symbol. All Strings and Symbols, including the empty String, are valid as property keys. A property name is a property key that is a String.

-

An integer index is a property name _n_ such that CanonicalNumericIndexString(_n_) returns an integral Number in the inclusive interval from *+0*𝔽 to 𝔽(253 - 1). An array index is an integer index _n_ such that CanonicalNumericIndexString(_n_) returns an integral Number in the inclusive interval from *+0*𝔽 to 𝔽(232 - 2).

+

A Uint53-string is a property name _n_ such that CanonicalNumericIndexString(_n_) returns an integral Number in the inclusive interval from *+0*𝔽 to 𝔽(253 - 1). A Uint32-string is a Uint53-string _n_ such that CanonicalNumericIndexString(_n_) returns an integral Number in the inclusive interval from *+0*𝔽 to 𝔽(232 - 2).

-

Every non-negative safe integer has a corresponding integer index. Every 32-bit unsigned integer except 232 - 1 has a corresponding array index. *"-0"* is neither an integer index nor an array index.

+

Every non-negative safe integer has a corresponding Uint53-string. Every 32-bit unsigned integer except 232 - 1 has a corresponding Uint32-string. *"-0"* is neither a Uint53-string nor a Uint32-string.

+

A Uint53-indexed property is one whose property key is a Uint53-string. Similarly, a Uint32-indexed property is one whose property key is a Uint32-string.

Property keys are used to access properties and their values. There are two kinds of access for properties: get and set, corresponding to value retrieval and assignment, respectively. The properties accessible via get and set access includes both own properties that are a direct part of an object and inherited properties which are provided by another associated object via a property inheritance relationship. Inherited properties may be either own or inherited properties of the associated object. Each own property of an object must each have a key value that is distinct from the key values of the other own properties of that object.

All objects are logically collections of properties, but there are multiple forms of objects that differ in their semantics for accessing and manipulating their properties. Please see for definitions of the multiple forms of objects.

In addition, some objects are callable; these are referred to as functions or function objects and are described further below. All functions in ECMAScript are members of the Object type.

@@ -5662,7 +5663,7 @@

description
-
It converts _value_ to an integer and returns that integer if it is non-negative and corresponds with an integer index. Otherwise, it throws an exception.
+
It converts _value_ to an integer and returns that integer if it is non-negative and corresponds with a Uint53-string value. Otherwise, it throws an exception.
1. Let _integer_ be ? ToIntegerOrInfinity(_value_). @@ -12971,9 +12972,9 @@

1. Let _keys_ be a new empty List. - 1. For each own property key _P_ of _O_ such that _P_ is an array index, in ascending numeric index order, do + 1. For each own property key _P_ of _O_ such that _P_ is a Uint32-string, in ascending numeric index order, do 1. Append _P_ to _keys_. - 1. For each own property key _P_ of _O_ such that _P_ is a String and _P_ is not an array index, in ascending chronological order of property creation, do + 1. For each own property key _P_ of _O_ such that _P_ is a String and _P_ is not a Uint32-string, in ascending chronological order of property creation, do 1. Append _P_ to _keys_. 1. For each own property key _P_ of _O_ such that _P_ is a Symbol, in ascending chronological order of property creation, do 1. Append _P_ to _keys_. @@ -14059,7 +14060,7 @@

Array Exotic Objects

-

An Array is an exotic object that gives special treatment to array index property keys (see ). A property whose property name is an array index is also called an element. Every Array has a non-configurable *"length"* property whose value is always a non-negative integral Number whose mathematical value is strictly less than 232. The value of the *"length"* property is numerically greater than the name of every own property whose name is an array index; whenever an own property of an Array is created or changed, other properties are adjusted as necessary to maintain this invariant. Specifically, whenever an own property is added whose name is an array index, the value of the *"length"* property is changed, if necessary, to be one more than the numeric value of that array index; and whenever the value of the *"length"* property is changed, every own property whose name is an array index whose value is not smaller than the new length is deleted. This constraint applies only to own properties of an Array and is unaffected by *"length"* or array index properties that may be inherited from its prototypes.

+

An Array is an exotic object that gives special treatment to Uint32-string property keys (see ). A property whose property name is a Uint32-string is also called an element. Every Array has a non-configurable *"length"* property whose value is always a non-negative integral Number whose mathematical value is strictly less than 232. The value of the *"length"* property is numerically greater than the name of every own property whose name is a Uint32-string; whenever an own property of an Array is created or changed, other properties are adjusted as necessary to maintain this invariant. Specifically, whenever an own property is added whose name is a Uint32-string, the value of the *"length"* property is changed, if necessary, to be one more than the numeric value of that Uint32-string; and whenever the value of the *"length"* property is changed, every own property whose name is a Uint32-string whose value is not smaller than the new length is deleted. This constraint applies only to own properties of an Array and is unaffected by *"length"* or Uint32-indexed properties that may be inherited from its prototypes.

An object is an Array exotic object (or simply, an Array) if its [[DefineOwnProperty]] internal method uses the following implementation, and its other essential internal methods use the definitions found in . These methods are installed in ArrayCreate.

@@ -14077,7 +14078,7 @@

1. If _P_ is *"length"*, then 1. Return ? ArraySetLength(_A_, _Desc_). - 1. Else if _P_ is an array index, then + 1. Else if _P_ is a Uint32-string, then 1. Let _lengthDesc_ be OrdinaryGetOwnProperty(_A_, *"length"*). 1. Assert: IsDataDescriptor(_lengthDesc_) is *true*. 1. Assert: _lengthDesc_.[[Configurable]] is *false*. @@ -14182,7 +14183,7 @@

1. Set _newLenDesc_.[[Writable]] to *true*. 1. Let _succeeded_ be ! OrdinaryDefineOwnProperty(_A_, *"length"*, _newLenDesc_). 1. If _succeeded_ is *false*, return *false*. - 1. For each own property key _P_ of _A_ such that _P_ is an array index and ! ToUint32(_P_) ≥ _newLen_, in descending numeric index order, do + 1. For each own property key _P_ of _A_ such that _P_ is a Uint32-string and ! ToUint32(_P_) ≥ _newLen_, in descending numeric index order, do 1. Let _deleteSucceeded_ be ! _A_.[[Delete]](_P_). 1. If _deleteSucceeded_ is *false*, then 1. Set _newLenDesc_.[[Value]] to ! ToUint32(_P_) + *1*𝔽. @@ -14202,7 +14203,7 @@

String Exotic Objects

-

A String object is an exotic object that encapsulates a String value and exposes virtual integer-indexed data properties corresponding to the individual code unit elements of the String value. String exotic objects always have a data property named *"length"* whose value is the length of the encapsulated String value. Both the code unit data properties and the *"length"* property are non-writable and non-configurable.

+

A String object is an exotic object that encapsulates a String value and exposes virtual Uint53-indexed data properties corresponding to the individual code unit elements of the String value. String exotic objects always have a data property named *"length"* whose value is the length of the encapsulated String value. Both the code unit data properties and the *"length"* property are non-writable and non-configurable.

An object is a String exotic object (or simply, a String object) if its [[GetOwnProperty]], [[DefineOwnProperty]], and [[OwnPropertyKeys]] internal methods use the following implementations, and its other essential internal methods use the definitions found in . These methods are installed in StringCreate.

@@ -14258,9 +14259,9 @@

[[OwnPropertyKeys]] ( ): a normal completion containing a List of property k 1. Let _len_ be the length of _str_. 1. For each integer _i_ such that 0 ≤ _i_ < _len_, in ascending order, do 1. Append ! ToString(𝔽(_i_)) to _keys_. - 1. For each own property key _P_ of _O_ such that _P_ is an array index and ! ToIntegerOrInfinity(_P_) ≥ _len_, in ascending numeric index order, do + 1. For each own property key _P_ of _O_ such that _P_ is a Uint32-string and ! ToIntegerOrInfinity(_P_) ≥ _len_, in ascending numeric index order, do 1. Append _P_ to _keys_. - 1. For each own property key _P_ of _O_ such that _P_ is a String and _P_ is not an array index, in ascending chronological order of property creation, do + 1. For each own property key _P_ of _O_ such that _P_ is a String and _P_ is not a Uint32-string, in ascending chronological order of property creation, do 1. Append _P_ to _keys_. 1. For each own property key _P_ of _O_ such that _P_ is a Symbol, in ascending chronological order of property creation, do 1. Append _P_ to _keys_. @@ -14320,7 +14321,7 @@

Arguments Exotic Objects

-

Most ECMAScript functions make an arguments object available to their code. Depending upon the characteristics of the function definition, its arguments object is either an ordinary object or an arguments exotic object. An arguments exotic object is an exotic object whose array index properties map to the formal parameters bindings of an invocation of its associated ECMAScript function.

+

Most ECMAScript functions make an arguments object available to their code. Depending upon the characteristics of the function definition, its arguments object is either an ordinary object or an arguments exotic object. An arguments exotic object is an exotic object whose Uint32-indexed properties map to the formal parameters bindings of an invocation of its associated ECMAScript function.

An object is an arguments exotic object if its internal methods use the following implementations, with the ones not specified here using those found in . These methods are installed in CreateMappedArgumentsObject.

@@ -14331,7 +14332,7 @@

Arguments Exotic Objects

Arguments exotic objects have the same internal slots as ordinary objects. They also have a [[ParameterMap]] internal slot. Ordinary arguments objects also have a [[ParameterMap]] internal slot whose value is always undefined. For ordinary argument objects the [[ParameterMap]] internal slot is only used by `Object.prototype.toString` () to identify them as such.

-

The integer-indexed data properties of an arguments exotic object whose numeric name values are less than the number of formal parameters of the corresponding function object initially share their values with the corresponding argument bindings in the function's execution context. This means that changing the property changes the corresponding value of the argument binding and vice-versa. This correspondence is broken if such a property is deleted and then redefined or if the property is changed into an accessor property. If the arguments object is an ordinary object, the values of its properties are simply a copy of the arguments passed to the function and there is no dynamic linkage between the property values and the formal parameter values.

+

The Uint32-indexed data properties of an arguments exotic object whose numeric name values are less than the number of formal parameters of the corresponding function object initially share their values with the corresponding argument bindings in the function's execution context. This means that changing the property changes the corresponding value of the argument binding and vice-versa. This correspondence is broken if such a property is deleted and then redefined or if the property is changed into an accessor property. If the arguments object is an ordinary object, the values of its properties are simply a copy of the arguments passed to the function and there is no dynamic linkage between the property values and the formal parameter values.

The ParameterMap object and its property values are used as a device for specifying the arguments object correspondence to argument bindings. The ParameterMap object and the objects that are the values of its properties are not directly observable from ECMAScript code. An ECMAScript implementation does not need to actually create or use such objects to implement the specified semantics.

@@ -14580,7 +14581,7 @@

TypedArray Exotic Objects

-

A TypedArray is an exotic object that performs special handling of integer index property keys.

+

A TypedArray is an exotic object that performs special handling of Uint53-string property keys.

TypedArrays have the same internal slots as ordinary objects and additionally [[ViewedArrayBuffer]], [[ArrayLength]], [[ByteOffset]], [[ContentType]], and [[TypedArrayName]] internal slots.

An object is a TypedArray if its [[GetOwnProperty]], [[HasProperty]], [[DefineOwnProperty]], [[Get]], [[Set]], [[Delete]], and [[OwnPropertyKeys]] internal methods use the definitions in this section, and its other essential internal methods use the definitions found in . These methods are installed by TypedArrayCreate.

@@ -14725,7 +14726,7 @@

[[OwnPropertyKeys]] ( ): a normal completion containing a List of property k 1. Let _length_ be TypedArrayLength(_taRecord_). 1. For each integer _i_ such that 0 ≤ _i_ < _length_, in ascending order, do 1. Append ! ToString(𝔽(_i_)) to _keys_. - 1. For each own property key _P_ of _O_ such that _P_ is a String and _P_ is not an integer index, in ascending chronological order of property creation, do + 1. For each own property key _P_ of _O_ such that _P_ is a String and _P_ is not a Uint53-string, in ascending chronological order of property creation, do 1. Append _P_ to _keys_. 1. For each own property key _P_ of _O_ such that _P_ is a Symbol, in ascending chronological order of property creation, do 1. Append _P_ to _keys_. @@ -35506,7 +35507,7 @@

String.prototype [ %Symbol.iterator% ] ( )

Properties of String Instances

String instances are String exotic objects and have the internal methods specified for such objects. String instances inherit properties from the String prototype object. String instances also have a [[StringData]] internal slot. The [[StringData]] internal slot is the String value represented by this String object.

-

String instances have a *"length"* property, and a set of enumerable properties with integer-indexed names.

+

String instances have a *"length"* property, and a set of enumerable properties with Uint53-string names.

length

@@ -40109,14 +40110,14 @@

Array.prototype [ %Symbol.unscopables% ]

Properties of Array Instances

Array instances are Array exotic objects and have the internal methods specified for such objects. Array instances inherit properties from the Array prototype object.

-

Array instances have a *"length"* property, and a set of enumerable properties with array index names.

+

Array instances have a *"length"* property, and a set of enumerable properties with Uint32-string names.

length

-

The *"length"* property of an Array instance is a data property whose value is always numerically greater than the name of every configurable own property whose name is an array index.

+

The *"length"* property of an Array instance is a data property whose value is always numerically greater than the name of every configurable own property whose name is a Uint32-string.

The *"length"* property initially has the attributes { [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.

-

Reducing the value of the *"length"* property has the side-effect of deleting own array elements whose array index is between the old and new length values. However, non-configurable properties can not be deleted. Attempting to set the *"length"* property of an Array to a value that is numerically less than or equal to the largest numeric own property name of an existing non-configurable array-indexed property of the array will result in the length being set to a numeric value that is one greater than that non-configurable numeric own property name. See .

+

Reducing the value of the *"length"* property has the side-effect of deleting own array elements whose index is between the old and new length values. However, non-configurable properties can not be deleted. Attempting to set the *"length"* property of an Array to a value that is numerically less than or equal to the largest numeric own property name of an existing non-configurable Uint32-indexed property of the array will result in the length being set to a numeric value that is one greater than that non-configurable numeric own property name. See .

@@ -41233,7 +41234,7 @@

%TypedArray%.prototype.some ( _callback_ [ , _thisArg_ ] )

%TypedArray%.prototype.sort ( _comparator_ )

-

This is a distinct method that, except as described below, implements the same requirements as those of `Array.prototype.sort` as defined in . The implementation of this method may be optimized with the knowledge that the *this* value is an object that has a fixed length and whose integer-indexed properties are not sparse.

+

This is a distinct method that, except as described below, implements the same requirements as those of `Array.prototype.sort` as defined in . The implementation of this method may be optimized with the knowledge that the *this* value is an object that has a fixed length and whose Uint53-indexed properties are not sparse.

This method is not generic. The *this* value must be an object with a [[TypedArrayName]] internal slot.

It performs the following steps when called:

@@ -41293,7 +41294,7 @@

%TypedArray%.prototype.subarray ( _start_, _end_ )

%TypedArray%.prototype.toLocaleString ( [ _reserved1_ [ , _reserved2_ ] ] )

-

This is a distinct method that implements the same algorithm as `Array.prototype.toLocaleString` as defined in except that TypedArrayLength is called in place of performing a [[Get]] of *"length"*. The implementation of the algorithm may be optimized with the knowledge that the *this* value has a fixed length when the underlying buffer is not resizable and whose integer-indexed properties are not sparse. However, such optimization must not introduce any observable changes in the specified behaviour of the algorithm.

+

This is a distinct method that implements the same algorithm as `Array.prototype.toLocaleString` as defined in except that TypedArrayLength is called in place of performing a [[Get]] of *"length"*. The implementation of the algorithm may be optimized with the knowledge that the *this* value has a fixed length when the underlying buffer is not resizable and whose Uint53-indexed properties are not sparse. However, such optimization must not introduce any observable changes in the specified behaviour of the algorithm.

This method is not generic. ValidateTypedArray is called with the *this* value and ~seq-cst~ as arguments prior to evaluating the algorithm. If its result is an abrupt completion that exception is thrown instead of evaluating the algorithm.

If the ECMAScript implementation includes the ECMA-402 Internationalization API this method is based upon the algorithm for `Array.prototype.toLocaleString` that is in the ECMA-402 specification.

@@ -45906,7 +45907,7 @@

1. Return _final_. -

The representation of arrays includes only the elements in the interval from *+0*𝔽 (inclusive) to `array.length` (exclusive). Properties whose keys are not array indices are excluded from the stringification. An array is stringified as an opening LEFT SQUARE BRACKET, elements separated by COMMA, and a closing RIGHT SQUARE BRACKET.

+

The representation of arrays includes only the elements in the interval from *+0*𝔽 (inclusive) to `array.length` (exclusive). Any property whose key is not a Uint32-string is excluded from the stringification. An array is stringified as an opening LEFT SQUARE BRACKET, elements separated by COMMA, and a closing RIGHT SQUARE BRACKET.

@@ -51337,7 +51338,7 @@

The Strict Mode of ECMAScript

Arguments objects for strict functions define a non-configurable accessor property *"callee"* which throws a *TypeError* exception on access ().
  • - Arguments objects for strict functions do not dynamically share their array-indexed property values with the corresponding formal parameter bindings of their functions. (). + Arguments objects for strict functions do not dynamically share the values of their Uint32-indexed properties with the corresponding formal parameter bindings of their functions. ().
  • For strict functions, if an arguments object is created the binding of the local identifier `arguments` to the arguments object is immutable and hence may not be the target of an assignment expression. (). @@ -51429,7 +51430,7 @@

    Built-in Objects and Methods

    Corrections and Clarifications in ECMAScript 2015 with Possible Compatibility Impact

    - Edition 5 and 5.1 used a property existence test to determine whether a global object property corresponding to a new global declaration already existed. ECMAScript 2015 uses an own property existence test. This corresponds to what has been most commonly implemented by web browsers.

    -

    : The 5th Edition moved the capture of the current array length prior to the integer conversion of the array index or new length value. However, the captured length value could become invalid if the conversion process has the side-effect of changing the array length. ECMAScript 2015 specifies that the current array length must be captured after the possible occurrence of such side-effects.

    +

    : The 5th Edition moved the capture of the current array length prior to the integer conversion of the property name or new length value. However, the captured length value could become invalid if the conversion process has the side-effect of changing the array length. ECMAScript 2015 specifies that the current array length must be captured after the possible occurrence of such side-effects.

    : Previous editions permitted the TimeClip abstract operation to return either *+0*𝔽 or *-0*𝔽 as the representation of a 0 time value. ECMAScript 2015 specifies that *+0*𝔽 always returned. This means that for ECMAScript 2015 the time value of a Date is never observably *-0*𝔽 and methods that return time values never return *-0*𝔽.

    : If a UTC offset representation is not present, the local time zone is used. Edition 5.1 incorrectly stated that a missing time zone should be interpreted as *"z"*.

    : If the year cannot be represented using the Date Time String Format specified in a RangeError exception is thrown. Previous editions did not specify the behaviour for that case.