From 66b3fbd54ffdeaa36fa633bbb5bb07043ce6c2a9 Mon Sep 17 00:00:00 2001 From: JD Liu Date: Mon, 1 Jan 2018 20:07:31 +0800 Subject: [PATCH] translated: issue #9 --- translated/issues-9.html | 3440 +++++++++++++++++++------------------- 1 file changed, 1722 insertions(+), 1718 deletions(-) diff --git a/translated/issues-9.html b/translated/issues-9.html index cfdd357545..9402f6c098 100644 --- a/translated/issues-9.html +++ b/translated/issues-9.html @@ -1,201 +1,200 @@ -

ECMAScript Data Types and Values

-

Algorithms within this specification manipulate values each of which has an associated type. The possible value types are exactly those defined in this clause. Types are further subclassified into ECMAScript language types and specification types.

-

Within this specification, the notation “Type(_x_)” is used as shorthand for “the type of _x_” where “type” refers to the ECMAScript language and specification types defined in this clause. When the term “empty” is used as if it was naming a value, it is equivalent to saying “no value of any type”.

- +

ECMAScript 数据类型和值

+

本规范中算法操作每个具有相关类型的值。可能的值类型直接定义在本章节中。这些类型进一步分为 ECMAScript 语言类型与规范类型。

+

在本规范中,“Type(_x_)”表示法是“the type of _x_”的简写, 其中“type”指的是在本章节中定义的 ECMAScript 语言类型与规范类型。当一个值使用术语“empty”命名值时,它相当于说“没有任何类型的值(no value of any type)”。

-

ECMAScript Language Types

-

An ECMAScript language type corresponds to values that are directly manipulated by an ECMAScript programmer using the ECMAScript language. The ECMAScript language types are Undefined, Null, Boolean, String, Symbol, Number, and Object. An ECMAScript language value is a value that is characterized by an ECMAScript language type.

+

ECMAScript 语言类型

+

一个 ECMAScript 语言类型对应那些 ECMAScript 程序员在 ECMAScript 语言中直接使用的值。 ECMAScript 语言类型有 Undefined, Null, Boolean, String,Symbol, Number, Object。 一个ECMAScript 语言值是指拥有 ECMAScript 语言类型特点的值。

-

The Undefined Type

-

The Undefined type has exactly one value, called *undefined*. Any variable that has not been assigned a value has the value *undefined*.

+

Undefined 类型

+

Undefined 类型仅仅只有一个值,`undefined`。 任何尚未分配值的变量值都为 `undefined`。

-

The Null Type

-

The Null type has exactly one value, called *null*.

+

Null 类型

+

Null 类型只有一个值, `null`.

-

The Boolean Type

-

The Boolean type represents a logical entity having two values, called *true* and *false*.

+

Boolean 类型

+

Boolean 类型表示具有 `true` 和 `false` 两个值的逻辑实体。

-

The String Type

-

The String type is the set of all ordered sequences of zero or more 16-bit unsigned integer values (“elements”) up to a maximum length of 253-1 elements. The String type is generally used to represent textual data in a running ECMAScript program, in which case each element in the String is treated as a UTF-16 code unit value. Each element is regarded as occupying a position within the sequence. These positions are indexed with nonnegative integers. The first element (if any) is at index 0, the next element (if any) at index 1, and so on. The length of a String is the number of elements (i.e., 16-bit values) within it. The empty String has length zero and therefore contains no elements.

-

Where ECMAScript operations interpret String values, each element is interpreted as a single UTF-16 code unit. However, ECMAScript does not place any restrictions or requirements on the sequence of code units in a String value, so they may be ill-formed when interpreted as UTF-16 code unit sequences. Operations that do not interpret String contents treat them as sequences of undifferentiated 16-bit unsigned integers. The function `String.prototype.normalize` (see ) can be used to explicitly normalize a String value. `String.prototype.localeCompare` (see ) internally normalizes String values, but no other operations implicitly normalize the strings upon which they operate. Only operations that are explicitly specified to be language or locale sensitive produce language-sensitive results.

+

String 类型

+

String 类型是零个或多个 16 位无符号整数值(“元素”)的所有有序序列的集合,最大长度为 253-1 个元素。字符串类型通常用于表示正在运行的 ECMAScript 程序中的文本数据,在这种情况下,String中的每个元素都被视为一个 UTF-16 码元。 每个元素被认为占据该序列内的一个位置。 这些位置用非负整数索引。 第一个元素(如果有)在索引 0 处,下一个元素(如果有的话)在索引 1 处,以此类推。 String 的长度是序列中的元素个数(即 16-bit 值)。空字符串的长度为零,因此不包含元素。

+

ECMAScript 操作在解释字符串值时,每个元素都被认为是一个单独的 UTF-16 码元。但是,ECMAScript 对 String 值中的码元序列没有任何限制或要求,因此当按照 UTF-16 码元序列解释时, 它们可能是不正确的。(因为)不解释字符串内容的操作将它们当做无差别的 16-bit 无符号整数序列。可以使用函数 `String.prototype.normalize` (见)显式的把一个 String 值标准化。 `String.prototype.localeCompare`(见) 方法在函数内部(隐式地)标准化了 String 值,除此之外的其它方法都没有隐式地标准化字符串。 只有明确指定语言或区域敏感的操作才会产生语言敏感的结果。

-

The rationale behind this design was to keep the implementation of Strings as simple and high-performing as possible. If ECMAScript source text is in Normalized Form C, string literals are guaranteed to also be normalized, as long as they do not contain any Unicode escape sequences.

+

这种设计背后的理由是尽可能的保持 String 的实现简单和高效。 如果 ECMAScript 源文本符合 Normalized Form C,只要它们不包含任何 Unicode 转义序列,则字符串字面量保证也是标准化的。

-

Some operations interpret String contents as UTF-16 encoded Unicode code points. In that case the interpretation is:

+

一些操作将字符串内容解释为 UTF-16 编码的 Unicode 码点。 在这种情况下,解释过程是:

  • - A code unit in the range 0 to 0xD7FF or in the range 0xE000 to 0xFFFF is interpreted as a code point with the same value. + 在范围 0 到 0xD7FF 或 0xE000 到 0xFFFF 范围内的码元被解释为具有相同值的码点。
  • - A sequence of two code units, where the first code unit _c1_ is in the range 0xD800 to 0xDBFF and the second code unit _c2_ is in the range 0xDC00 to 0xDFFF, is a surrogate pair and is interpreted as a code point with the value (_c1_ - 0xD800) × 0x400 + (_c2_ - 0xDC00) + 0x10000. (See ) + 两个码元,第一个码元 _c1_ 范围为 0xD800 到 0xDBFF,第二个码元 _c2_ 范围为 0xDC00 到 0xDFFF, 这样的两个码元,被称为代理对, 被解释为一个值为 (_c1_ - 0xD800) × 0x400 + (_c2_ - 0xDC00) + 0x10000 的码点。
  • - A code unit that is in the range 0xD800 to 0xDFFF, but is not part of a surrogate pair, is interpreted as a code point with the same value. + 一个在 0xD800 到 0xDFFF 范围内,但不是代理对的一部分的码元被解释为具有相同值的码点。
-

In this specification, the phrase "the string-concatenation of _A_, _B_, ..." (where each argument is a String value, a code unit, or a sequence of code units) denotes the String value whose sequence of code units is the concatenation of the code units (in order) of each of the arguments (in order).

+

在本规范中,短语"the string-concatenation of _A_,_B_,..."表示字符串代码单元的序列是每个参数的代码单元的连接。

-

The Symbol Type

-

The Symbol type is the set of all non-String values that may be used as the key of an Object property ().

-

Each possible Symbol value is unique and immutable.

-

Each Symbol value immutably holds an associated value called [[Description]] that is either *undefined* or a String value.

+

Symbol 类型

+

Symbol 类型是所有可以用于作为 Object 属性的 key 的非字符串值的集合。().

+

每个可能的 Symbol 值都是唯一的和不可变的。

+

每个 Symbol 值永远地保持一个与之关联的叫做 [[Description]] 的值(它要么是 undefined 要么是一个 String 值)。

-

Well-Known Symbols

-

Well-known symbols are built-in Symbol values that are explicitly referenced by algorithms of this specification. They are typically used as the keys of properties whose values serve as extension points of a specification algorithm. Unless otherwise specified, well-known symbols values are shared by all realms ().

-

Within this specification a well-known symbol is referred to by using a notation of the form @@name, where “name” is one of the values listed in .

+

著名 Symbol

+

著名 Symbol 是那些被本规范中算法明确引用的内置 Symbol 值。它们通常被用作属性的 key,这些 key 的值为规范的算法提供了一种扩展。除非另有说明,著名 Symbol 的值被所有域()共享。

+

在本规范内,一个著名 Symbol 值通过形如 form@@name 的形式被引用,这里的 “name” 是表 列出的值之一。

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
- Specification Name - - [[Description]] - - Value and Purpose -
- @@hasInstance - - `"Symbol.hasInstance"` - - A method that determines if a constructor object recognizes an object as one of the constructor's instances. Called by the semantics of the `instanceof` operator. -
- @@isConcatSpreadable - - `"Symbol.isConcatSpreadable"` - - A Boolean valued property that if true indicates that an object should be flattened to its array elements by `Array.prototype.concat`. -
- @@iterator - - `"Symbol.iterator"` - - A method that returns the default Iterator for an object. Called by the semantics of the for-of statement. -
- @@match - - `"Symbol.match"` - - A regular expression method that matches the regular expression against a string. Called by the `String.prototype.match` method. -
- @@replace - - `"Symbol.replace"` - - A regular expression method that replaces matched substrings of a string. Called by the `String.prototype.replace` method. -
- @@search - - `"Symbol.search"` - - A regular expression method that returns the index within a string that matches the regular expression. Called by the `String.prototype.search` method. -
- @@species - - `"Symbol.species"` - - A function valued property that is the constructor function that is used to create derived objects. -
- @@split - - `"Symbol.split"` - - A regular expression method that splits a string at the indices that match the regular expression. Called by the `String.prototype.split` method. -
- @@toPrimitive - - `"Symbol.toPrimitive"` - - A method that converts an object to a corresponding primitive value. Called by the ToPrimitive abstract operation. -
- @@toStringTag - - `"Symbol.toStringTag"` - - A String valued property that is used in the creation of the default string description of an object. Accessed by the built-in method `Object.prototype.toString`. -
- @@unscopables - - `"Symbol.unscopables"` - - An object valued property whose own and inherited property names are property names that are excluded from the `with` environment bindings of the associated object. -
+ 名称 + + [[Description]] + + 值和目的 +
+ @@hasInstance + + `"Symbol.hasInstance"` + + 确定构造函数对象是否识别对象为构造函数实例之一的方法。由 `instanceof` 运算符语义来调用。 +
+ @@isConcatSpreadable + + `"Symbol.isConcatSpreadable"` + + 一个Boolean值,如果为 true, 表示一个对象应该被 `Array.prototype.concat` 扁平化的加入到元素中。 +
+ @@iterator + + `"Symbol.iterator"` + + 返回一个对象的默认 Iterator 的方法。由 for-of 声明的语义来调用。 +
+ @@match + + `"Symbol.match"` + + 将字符串与正则表达式匹配的正则表达式方法。 由 `String.prototype.match` 方法调用。 +
+ @@replace + + `"Symbol.replace"` + + 替换匹配字符串子串的正则表达式方法。 由 `String.prototype.replace` 方法调用。 +
+ @@search + + `"Symbol.search"` + + 一个正则表达式方法,它返回正则表达式匹配到在字符串中的索引。 由`String.prototype.search`方法调用。 +
+ @@species + + `"Symbol.species"` + + 作为构造函数的函数值属性,用来创建派生对象。 +
+ @@split + + `"Symbol.split"` + + 一个正则表达式方法,它在正则表达式匹配的索引位置拆分字符串。 由 `String.prototype.split` 方法调用。 +
+ @@toPrimitive + + `"Symbol.toPrimitive"` + + 将一个对象转换为相应原始值的方法。由抽象操作 ToPrimitive 调用。 +
+ @@toStringTag + + `"Symbol.toStringTag"` + + 一个字符串值属性,用于表示对象在创建时的默认字符串描述。通过内置方法 `Object.prototype.toString` 访问。 +
+ @@unscopables + + `"Symbol.unscopables"` + + 一个对象值属性,其自身和继承的属性名是从相关对象非在 `with` 环境绑定的属性名。 +
@@ -204,235 +203,237 @@

Well-Known Symbols

-

The Number Type

-

The Number type has exactly 18437736874454810627 (that is, 264-253+3) values, representing the double-precision 64-bit format IEEE 754-2008 values as specified in the IEEE Standard for Binary Floating-Point Arithmetic, except that the 9007199254740990 (that is, 253-2) distinct “Not-a-Number” values of the IEEE Standard are represented in ECMAScript as a single special *NaN* value. (Note that the *NaN* value is produced by the program expression `NaN`.) In some implementations, external code might be able to detect a difference between various Not-a-Number values, but such behaviour is implementation-dependent; to ECMAScript code, all *NaN* values are indistinguishable from each other.

+

Number 类型

+

Number 类型有 18437736874454810627 (即,264-253+3)个值,表示双精度 64 位格式的 IEEE 754-2008 值由 IEEE 二进制浮点数标准规定,除了 9007199254740990 (即,253-2)这个在 IEEE 标准中独特的 “Not-a-Number” 值,其在 ECMAScript 中表示为一个特殊的 `NaN` 值。(注意 `NaN` 值在程序中由 `NaN` 表达式产生)在某些实现中,外部代码可能能够检测各种 Not-a-Number 值之间的差异,但这种行为依赖于实现; 对于 ECMAScript 代码,所有的 `NaN` 值彼此是不可区分。

-

The bit pattern that might be observed in an ArrayBuffer (see ) or a SharedArrayBuffer (see ) after a Number value has been stored into it is not necessarily the same as the internal representation of that Number value used by the ECMAScript implementation.

+

一个可被观察的 ArrayBuffer(见) 或 SharedArrayBuffer(见) 中存入一个Number值之后的位模式没有必要与 ECMAScript 实现内部代表的 Number 值相同。

-

There are two other special values, called *positive Infinity* and *negative Infinity*. For brevity, these values are also referred to for expository purposes by the symbols *+∞* and *-∞*, respectively. (Note that these two infinite Number values are produced by the program expressions `+Infinity` (or simply `Infinity`) and `-Infinity`.)

-

The other 18437736874454810624 (that is, 264-253) values are called the finite numbers. Half of these are positive numbers and half are negative numbers; for every finite positive Number value there is a corresponding negative value having the same magnitude.

-

Note that there is both a *positive zero* and a *negative zero*. For brevity, these values are also referred to for expository purposes by the symbols *+0* and *-0*, respectively. (Note that these two different zero Number values are produced by the program expressions `+0` (or simply `0`) and `-0`.)

-

The 18437736874454810622 (that is, 264-253-2) finite nonzero values are of two kinds:

-

18428729675200069632 (that is, 264-254) of them are normalized, having the form

+

还有另外两个特殊的值,叫做*正无穷**负无穷*。 为了简洁起见,这些值分别由符号 `+∞` 和 `-∞` 表示。(请注意,这两个无限数值由程序表达式 `+Infinity`(或 `Infinity` )和 `-Infinity` 产生。)

+

除了 3 个特殊值,其他 18437736874454810624(即,264-253)个值称为有限值。 其中一半为正数,一般为负数;每个有限正数存在相同大小的对应负数。

+

注意其中有一个*正零*,一个*负零*。为了简洁,他们也分别用 `+0` 和 `-0` 来说明。(注意这两个不同的 0,通过程序表达式 `+0`(或 `0`) 和 `-0` 产生。)

+

18437736874454810622(即 264-253-2)个有限非 0 值有两种:

+

其中 18428729675200069632 (即 264-254) 个值是标准的, 具有如下格式

_s_ × _m_ × 2_e_
-

where _s_ is +1 or -1, _m_ is a positive integer less than 253 but not less than 252, and _e_ is an integer ranging from -1074 to 971, inclusive.

-

The remaining 9007199254740990 (that is, 253-2) values are denormalized, having the form

+

其中 _s_ 为 +1 或 -1,_m_ 是一个小于 253 大于等于 252 的整数,_e_ 是从 -1074 到 971 的整数。

+

其余 9007199254740990 (即 253-2) 个值是非标准的, 有如下格式

_s_ × _m_ × 2_e_
-

where _s_ is +1 or -1, _m_ is a positive integer less than 252, and _e_ is -1074.

-

Note that all the positive and negative integers whose magnitude is no greater than 253 are representable in the Number type (indeed, the integer 0 has two representations, *+0* and *-0*).

-

A finite number has an odd significand if it is nonzero and the integer _m_ used to express it (in one of the two forms shown above) is odd. Otherwise, it has an even significand.

-

In this specification, the phrase “the Number value for _x_” where _x_ represents an exact real mathematical quantity (which might even be an irrational number such as π) means a Number value chosen in the following manner. Consider the set of all finite values of the Number type, with *-0* removed and with two additional values added to it that are not representable in the Number type, namely 21024 (which is +1 × 253 × 2971) and -21024 (which is -1 × 253 × 2971). Choose the member of this set that is closest in value to _x_. If two values of the set are equally close, then the one with an even significand is chosen; for this purpose, the two extra values 21024 and -21024 are considered to have even significands. Finally, if 21024 was chosen, replace it with *+∞*; if -21024 was chosen, replace it with *-∞*; if *+0* was chosen, replace it with *-0* if and only if _x_ is less than zero; any other chosen value is used unchanged. The result is the Number value for _x_. (This procedure corresponds exactly to the behaviour of the IEEE 754-2008 “round to nearest, ties to even” mode.)

-

Some ECMAScript operators deal only with integers in specific ranges such as -231 through 231-1, inclusive, or in the range 0 through 216-1, inclusive. These operators accept any value of the Number type but first convert each such value to an integer value in the expected range. See the descriptions of the numeric conversion operations in .

+

其中 s 是 +1 或 -1 ,m 是小于 52 的正整数,e 是 -1074。

+

注意,大小不大于 253 的所有正整数和负整数可以在数字类型中表示(实际上,整数 0 具有两个表示,`+0` 和 `-0`)。

+

如果一个有限的数值非零且用来表达它(上文两种形式之一)的整数 m 是奇数,则该数值有奇数意义。否则,它有偶数意义

+

在本规范中,当 _x_ 表示一个精确的非零实数数学量(甚至可以是无理数,比如π)时,“the Number value for _x_” 意为,以下面的方式选择一个 Number 值。考虑 Number 类型中除了 `-0` 和两个被加入在数值类型中但不可呈现的值,21024 (+1 × 253 × 2971) 以及 -21024(-1 × 253 × 2971)的所有有限值的集合。选择此集合中值最接近 _x_ 的一员。若集合中的两值近似相等,那么选择有偶数意义的那个;为此,21024-21024这两个超额值被认为有偶数意义。最终,若选择 21024 ,用 `+∞` 替换它;若选择 -21024, 用 `-∞` 替换它;若选择 `+0`,有且只有 _x_ 小于零时,用 `-0` 替换它;其它任何被选取的值都不用改变。结果就是 _x_ 的数字值。(此过程正是IEEE 754-2008“round to nearest, ties to even”模式对应的行为。)

+

某些 ECMAScript 运算符仅处理闭区间 -231231-1,或者 0 到 216-1 的整数。 这些操作符接收任意 Number 类型的值,首先会将它们转换成像上面提到的这些范围内的值。参考的数字转换操作。

-

The Object Type

-

An Object is logically a collection of properties. Each property is either a data property, or an accessor property:

+

Object 类型

+

对象在逻辑上是属性的集合。每个属性都是一个数据属性或一个访问器属性:

  • - A data property associates a key value with an ECMAScript language value and a set of Boolean attributes. + 数据属性关联 key 值和一个 ECMAScript 语言值以及一组值为 Boolean 类型的特性。
  • - An accessor property associates a key value with one or two accessor functions, and a set of Boolean attributes. The accessor functions are used to store or retrieve an ECMAScript language value that is associated with the property. + 访问器属性关联 key 值和一个或两个访问器函数以及一组值为 Boolean 类型的特性。访问器函数用于存储或检索与属性相关联的 ECMAScript 语言值。
-

Properties are identified using key values. A property key value is either an ECMAScript String value or a Symbol value. All String and Symbol values, including the empty string, are valid as property keys. A property name is a property key that is a String value.

-

An integer index is a String-valued property key that is a canonical numeric String (see ) and whose numeric value is either *+0* or a positive integer ≤ 253-1. An array index is an integer index whose numeric value _i_ is in the range +0 ≤ _i_ < 232-1.

-

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. Ordinary objects are the most common form of objects and have the default object semantics. An exotic object is any form of object whose property semantics differ in any way from the default semantics.

+

属性使用 key 值来标识。一个属性的 key 值是 ECMAScript String 值或 Symbol 值。所有 String 值(包括空字符串) 和 Symbol 值作为属性的 key 都是有效的。一个属性的 key 为 String 值时,属性名称为属性的 key 。

+

一个值为 `+0` 或者一个 ≤ 253-1 的整数作为属性 key 字符串值的整数索引是一个以典型的数字 String。 一个数组索引是范围在 +0 ≤ _i_ < 232-1 的整数。

+

属性的 key 用来访问属性以及其值。属性有两种访问方式:getset ,分别对应值的检索和赋值。通过 get 和 set 可访问的属性既包括直接属于的自身属性,也包括通过继承关系由其它相关对象提供的继承属性。继承属性也可能是另一个对象的自身属性或者继承属性。对象的每个自身属性必须有一个与对象的其他自身属性 key 值不同 key 值。

+

所有的对象都是逻辑上的属性集合,但是在用于访问和操纵它们的属性的语义中存在多种形式的对象。普通对象是对象的最常见形式,拥有默认的对象语义。奇异对象是指其属性语义与默认语义的各个方面都有区别的对象。

-

Property Attributes

-

Attributes are used in this specification to define and explain the state of Object properties. A data property associates a key value with the attributes listed in .

+

属性特性

+

在本规范中特性用来定义和解释对象属性的状态。数据属性关联表中列出的一个 key 值的特性。

- - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + +
- Attribute Name - - Value Domain - - Description -
- [[Value]] - - Any ECMAScript language type - - The value retrieved by a get access of the property. -
- [[Writable]] - - Boolean - - If *false*, attempts by ECMAScript code to change the property's [[Value]] attribute using [[Set]] will not succeed. -
- [[Enumerable]] - - Boolean - - If *true*, the property will be enumerated by a for-in enumeration (see ). Otherwise, the property is said to be non-enumerable. -
- [[Configurable]] - - Boolean - - If *false*, attempts to delete the property, change the property to be an accessor property, or change its attributes (other than [[Value]], or changing [[Writable]] to *false*) will fail. -
+ 特性名称 + + 值域 + + 描述 +
+ [[Value]] + + 任何 ECMAScript 语言类型 + + get 访问检索到的属性值 +
+ [[Writable]] + + Boolean + + 如果为 *false*,尝试通过 [[Set]] 去改变属性的 [[Value]] 特性的 ECMAScript 代码将不会成功。 +
+ [[Enumerable]] + + Boolean + + 如果为 *true*, 这个属性被 for-in 枚举时将会是可枚举的(见)。否则,这个属性就是不可枚举的。 +
+ [[Configurable]] + + Boolean + + 如果为 *false*,尝试删除这个属性,把这个属性改为访问器属性,或者改变它的的特性(除了修改 [[Value]],或修改 [[Writable]] 为 false 之外)都会失败。 +
-

An accessor property associates a key value with the attributes listed in .

+

+ 访问器属性关联表中的列出一个值。 +

- - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + +
- Attribute Name - - Value Domain - - Description -
- [[Get]] - - Object | Undefined - - If the value is an Object it must be a function object. The function's [[Call]] internal method () is called with an empty arguments list to retrieve the property value each time a get access of the property is performed. -
- [[Set]] - - Object | Undefined - - If the value is an Object it must be a function object. The function's [[Call]] internal method () is called with an arguments list containing the assigned value as its sole argument each time a set access of the property is performed. The effect of a property's [[Set]] internal method may, but is not required to, have an effect on the value returned by subsequent calls to the property's [[Get]] internal method. -
- [[Enumerable]] - - Boolean - - If *true*, the property is to be enumerated by a for-in enumeration (see ). Otherwise, the property is said to be non-enumerable. -
- [[Configurable]] - - Boolean - - If *false*, attempts to delete the property, change the property to be a data property, or change its attributes will fail. -
+ 特性名称 + + 值域 + + 描述 +
+ [[Get]] + + Object | Undefined + + 如果这个值是一个对象,那么它必须是一个函数对象。在每次取值(get 访问该属性被执行)时,这个函数的内部 [[Call]] 方法()将会以一个空 arguments 列表调用获取属性值。 +
+ [[Set]] + + Object | Undefined + + 如果这个值是一个对象,那么它必须是一个函数对象。在每次赋值(set 访问该属性被执行)时,这个函数的内部 [[Call]] 方法()将会以一个包含分配的值为参数的 arguments 调用。内部方法 [[Set]] 应该会对后续的内部方法 [[Get]] 调用产生的返回值产生影响,但不是必须的。 +
+ [[Enumerable]] + + Boolean + + 如果为 *true*,这个属性被 for-in 枚举时将会是可枚举的(见)。 否则,这个属性就是不可枚举的。 +
+ [[Configurable]] + + Boolean + + 如果为 *false*,任何尝试删除这个属性,把这个属性改为数据属性,或者改变它的其它特性的操作都会失败。 +
-

If the initial values of a property's attributes are not explicitly specified by this specification, the default value defined in is used.

+

如果一个属性的特性的初始值没有被本规范显式地指定的,那么使用在表中定义的默认值。

- - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + +
- Attribute Name - - Default Value -
- [[Value]] - - *undefined* -
- [[Get]] - - *undefined* -
- [[Set]] - - *undefined* -
- [[Writable]] - - *false* -
- [[Enumerable]] - - *false* -
- [[Configurable]] - - *false* -
+ 特性名 + + 默认值 +
+ [[Value]] + + *undefined* +
+ [[Get]] + + *undefined* +
+ [[Set]] + + *undefined* +
+ [[Writable]] + + *false* +
+ [[Enumerable]] + + *false* +
+ [[Configurable]] + + *false* +
@@ -440,1513 +441,1516 @@

Property Attributes

-

Object Internal Methods and Internal Slots

-

The actual semantics of objects, in ECMAScript, are specified via algorithms called internal methods. Each object in an ECMAScript engine is associated with a set of internal methods that defines its runtime behaviour. These internal methods are not part of the ECMAScript language. They are defined by this specification purely for expository purposes. However, each object within an implementation of ECMAScript must behave as specified by the internal methods associated with it. The exact manner in which this is accomplished is determined by the implementation.

-

Internal method names are polymorphic. This means that different object values may perform different algorithms when a common internal method name is invoked upon them. That actual object upon which an internal method is invoked is the “target” of the invocation. If, at runtime, the implementation of an algorithm attempts to use an internal method of an object that the object does not support, a *TypeError* exception is thrown.

-

Internal slots correspond to internal state that is associated with objects and used by various ECMAScript specification algorithms. Internal slots are not object properties and they are not inherited. Depending upon the specific internal slot specification, such state may consist of values of any ECMAScript language type or of specific ECMAScript specification type values. Unless explicitly specified otherwise, internal slots are allocated as part of the process of creating an object and may not be dynamically added to an object. Unless specified otherwise, the initial value of an internal slot is the value *undefined*. Various algorithms within this specification create objects that have internal slots. However, the ECMAScript language provides no direct way to associate internal slots with an object.

-

Internal methods and internal slots are identified within this specification using names enclosed in double square brackets [[ ]].

-

summarizes the essential internal methods used by this specification that are applicable to all objects created or manipulated by ECMAScript code. Every object must have algorithms for all of the essential internal methods. However, all objects do not necessarily use the same algorithms for those methods.

-

The “Signature” column of and other similar tables describes the invocation pattern for each internal method. The invocation pattern always includes a parenthesized list of descriptive parameter names. If a parameter name is the same as an ECMAScript type name then the name describes the required type of the parameter value. If an internal method explicitly returns a value, its parameter list is followed by the symbol “→” and the type name of the returned value. The type names used in signatures refer to the types defined in clause augmented by the following additional names. “any” means the value may be any ECMAScript language type. An internal method implicitly returns a Completion Record. In addition to its parameters, an internal method always has access to the object that is the target of the method invocation.

+

对象的内部方法以及内部槽

+

在 ECMAScript 中,对象的实际语义是通过算法来调用内部方法指定的。在 ECMAScript 引擎中的每个对象都与一系列的定义它的运行时行为的内部方法相关联。这些内部方法不属于 ECMAScript 语言的一部分。本规范定义它们纯粹是为了说明目的。但是,在 ECMAScript 具体实现中的每个对象必须表现得与其相关关联的内部方法一致。其中确切的方式由实现者来决定。

+

内部方法名称是多态的。这意味着当一个通用内部方法被调用的时候,不同的对象值可能会执行不同的算法。调用内部方法实际的对象是这个调用 “target”。如果在运行时,实现的算法尝试使用一个对象不支持的内部方法,抛出一个`TypeError`异常。

+

内部槽对应于相关对象的内部状态,用于各种 ECMAScript 规范算法。内部槽不是对象的属性,也不会被继承。根据具体的内部槽规范,内部状态可能由任意 ECMAScript 语言类型的值或者指定的 ECMAScript 规范类型的值组成。除非另有指定,否则分配内部槽应作为创建一个对象的过程的部分,并且不应该动态地添加到对象上。除非另有指定,否则一个内部槽的初始值是 *undefined*。本规范内很多算法都会创建有内部槽的对象。然而,ECMAScript 语言不提供直接去访问一个对象内部槽的方法。

+

本规范内的内部方法和内部槽使用闭合的双方括号 [[]] 来标识。

+

总结了本规范中适用于所有通过 ECMAScript 代码创建或者操作的对象的基本内部方法。每个对象必须有所有基本内部方法的算法。不过,对于那些方法不必所有的对象都用一样的算法。

+

中的 “Signature” 列以及其它相似的表格描述了每个内部方法的调用模式。调用模式总是包含一个括起来的描述参数名的列表。如果一个参数名与 ECMAScript 类型的名字一样,则该名称描述了参数值的所需类型。如果一个内部方法显式地返回了一个值,则它的参数列表接着是一个 “→” 符号,以及返回值的类型名称。 在 “Signature” 列中使用的类型名称指向在中定义的类型,以及一些附加的名称。 “any” 意味着这个值可以是任意的 ECMAScript 语言值。一个内部方法会隐式地返回一个 Completion Record。 除了它的参数,一个内部方法还总会访问调用这个方法的目标对象。

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
- Internal Method - - Signature - - Description -
- [[GetPrototypeOf]] - - ( ) Object | Null - - Determine the object that provides inherited properties for this object. A *null* value indicates that there are no inherited properties. -
- [[SetPrototypeOf]] - - (Object | Null) Boolean - - Associate this object with another object that provides inherited properties. Passing *null* indicates that there are no inherited properties. Returns *true* indicating that the operation was completed successfully or *false* indicating that the operation was not successful. -
- [[IsExtensible]] - - ( ) Boolean - - Determine whether it is permitted to add additional properties to this object. -
- [[PreventExtensions]] - - ( ) Boolean - - Control whether new properties may be added to this object. Returns *true* if the operation was successful or *false* if the operation was unsuccessful. -
- [[GetOwnProperty]] - - (_propertyKey_) Undefined | Property Descriptor - - Return a Property Descriptor for the own property of this object whose key is _propertyKey_, or *undefined* if no such property exists. -
- [[DefineOwnProperty]] - - (_propertyKey_, _PropertyDescriptor_) Boolean - - Create or alter the own property, whose key is _propertyKey_, to have the state described by _PropertyDescriptor_. Return *true* if that property was successfully created/updated or *false* if the property could not be created or updated. -
- [[HasProperty]] - - (_propertyKey_) Boolean - - Return a Boolean value indicating whether this object already has either an own or inherited property whose key is _propertyKey_. -
- [[Get]] - - (_propertyKey_, _Receiver_) any - - Return the value of the property whose key is _propertyKey_ from this object. If any ECMAScript code must be executed to retrieve the property value, _Receiver_ is used as the *this* value when evaluating the code. -
- [[Set]] - - (_propertyKey_, _value_, _Receiver_) Boolean - - Set the value of the property whose key is _propertyKey_ to _value_. If any ECMAScript code must be executed to set the property value, _Receiver_ is used as the *this* value when evaluating the code. Returns *true* if the property value was set or *false* if it could not be set. -
- [[Delete]] - - (_propertyKey_) Boolean - - Remove the own property whose key is _propertyKey_ from this object. Return *false* if the property was not deleted and is still present. Return *true* if the property was deleted or is not present. -
- [[OwnPropertyKeys]] - - ( ) List of propertyKey - - Return a List whose elements are all of the own property keys for the object. -
+ Internal Method + + Signature + + Description +
+ [[GetPrototypeOf]] + + ( ) Object | Null + + 确定为对象提供继承属性的对象。*null* 值表示没有继承属性。 +
+ [[SetPrototypeOf]] + + (Object | Null) Boolean + + 关联这个对象与提供继承属性的对象。传递 *null* 表示没有继承属性。返回 true 表示操作成功完成,返回 false 表示操作失败。 +
+ [[IsExtensible]] + + ( ) Boolean + + 决定是否允许添加额外的属性到这个对象上。 +
+ [[PreventExtensions]] + + ( ) Boolean + + 控制一个新的属性是否能加到这个对象上。返回 true 表示操作成功,返回 false 表示操作失败。 +
+ [[GetOwnProperty]] + + (_propertyKey_) Undefined | Property Descriptor + + 返回对象自身属性中 key 值为 _propertyKey_ 的属性的属性描述符,如果没有这个属性返回`undefined`。 +
+ [[DefineOwnProperty]] + + (_propertyKey_, _PropertyDescriptor_) Boolean + + 创建或者改变 key 值为 _propertyKey_ 的自身属性状态为 _PropertyDescriptor_。返回 true 表示属性被成功创建/更新,返回 false 表示属性不能被创建/更新。 +
+ [[HasProperty]] + + (_propertyKey_) Boolean + + 返回一个 Boolean 值,代表这个对象自身或者继承了一个 key 值为 _propertyKey_ 的属性。 +
+ [[Get]] + + (_propertyKey_, _Receiver_) any + + 返回这个对象里 key 值为 _propertyKey_ 的属性的值。如果必须运行一些的 ECMAScript 代码来检索这个属性值,_Receiver_ 就会作为解析代码时的 *this* 值。 +
+ [[Set]] + + (_propertyKey_, _value_, _Receiver_) Boolean + + 设置这个对象 key 值为 _propertyKey_ 的属性的值为 _value_。如果必须运行一些的 ECMAScript 代码来检索这个属性值,_Receiver_ 就会作为解析代码时的 *this* 值。返回 *true* 表示这个属性值已经设置,返回 *false* 表示不能被设置。 +
+ [[Delete]] + + (_propertyKey_) Boolean + + 移除这个对象 key 值为 _propertyKey_ 的自身属性。 如果这个属性没有被移除,仍然存在,则返回 *false*。 如果属性被移除,或不存在,则返回 *true*。 +
+ [[OwnPropertyKeys]] + + ( ) List of propertyKey + + 返回一个包含所有自身属性 key 值的 List。 +
-

summarizes additional essential internal methods that are supported by objects that may be called as functions. A function object is an object that supports the [[Call]] internal method. A constructor (also referred to as a constructor function) is a function object that supports the [[Construct]] internal method.

+

总结了用来支持对象被作为函数调用的其他基础内部方法。 函数对象是支持内部方法 [[Call]] 的对象。 构造器(也叫作构造函数)是支持内部方法 [[Construct]] 的函数对象。

- - - - - - - - - - - - - - - + + + + + + + + + + + + + + +
- Internal Method - - Signature - - Description -
- [[Call]] - - (any, a List of any) any - - Executes code associated with this object. Invoked via a function call expression. The arguments to the internal method are a *this* value and a list containing the arguments passed to the function by a call expression. Objects that implement this internal method are callable. -
- [[Construct]] - - (a List of any, Object) Object - - Creates an object. Invoked via the `new` or `super` operators. The first argument to the internal method is a list containing the arguments of the operator. The second argument is the object to which the `new` operator was initially applied. Objects that implement this internal method are called constructors. A function object is not necessarily a constructor and such non-constructor function objects do not have a [[Construct]] internal method. -
+ Internal Method + + Signature + + Description +
+ [[Call]] + + (any, a List of any) any + + 执行这个对象相关联的代码。通过一个函数表达式来调用。通过调用表达式,传递给内部函数的 arguments 为一个 *this* 值,和一个包含传递给函数的参数列表,实现该内部方法的对象是可调用的 +
+ [[Construct]] + + (a List of any, Object) Object + + 创建一个对象。通过 `new` 或者 `super` 操作符调用。这个内部方法的第一个参数是一个包含操作符的参数的列表。第二个参数是 `new` 操作符初始化时应用的对象。实现这个内部方法的对象被称为构造函数。一个函数对象不一定是构造函数,这样的非构造函数的函数对象没有 [[Construct]] 内部方法。 +
-

The semantics of the essential internal methods for ordinary objects and standard exotic objects are specified in clause . If any specified use of an internal method of an exotic object is not supported by an implementation, that usage must throw a *TypeError* exception when attempted.

+

这些普通对象和标准的怪异对象的基础内部方法语义在指出。如果怪异对象的任何特定内部方法不被实现支持,那么在尝试使用时,必须抛出一个 *TypeError* 异常。

-

Invariants of the Essential Internal Methods

-

The Internal Methods of Objects of an ECMAScript engine must conform to the list of invariants specified below. Ordinary ECMAScript Objects as well as all standard exotic objects in this specification maintain these invariants. ECMAScript Proxy objects maintain these invariants by means of runtime checks on the result of traps invoked on the [[ProxyHandler]] object.

-

Any implementation provided exotic objects must also maintain these invariants for those objects. Violation of these invariants may cause ECMAScript code to have unpredictable behaviour and create security issues. However, violation of these invariants must never compromise the memory safety of an implementation.

-

An implementation must not allow these invariants to be circumvented in any manner such as by providing alternative interfaces that implement the functionality of the essential internal methods without enforcing their invariants.

-

Definitions:

+

基本内部方法的不变量

+

ECMAScript 引擎中的内部方法必须符合以下指定的不变量列表。普通 ECMAScript 对象以及该规范中的标准怪异对象应保持这些不变量。ECMAScript Proxy 对象通过运行时检查 [[ProxyHandler]] 对象的陷阱调用结果的手段来保持这些不变量。

+

任何实现提供的怪异对象必须也保持这些不变量。违反这些不变量可能会导致 ECMAScript 代码出现不可预料的行为以及安全问题。然而,对于造成内存安全的违反不变量行为的实现决不能妥协。

+

实现不允许通过任何方式规避这些不变量。比如,通过提供替代接口来实现基本内部方法的功能而不强制执行他们的不变量。

+

定义:

  • - The target of an internal method is the object upon which the internal method is called. + 内部方法的 target 是调用这个内部方法的对象。
  • - A target is non-extensible if it has been observed to return false from its [[IsExtensible]] internal method, or true from its [[PreventExtensions]] internal method. + 如果 target 的 [[IsExtensible]] 内部方法返回值是 false 或者 [[PreventExtensions]] 内部方法返回值是 true,那么这个 target 是不可扩展的
  • - A non-existent property is a property that does not exist as an own property on a non-extensible target. + 一个不存在的属性是指一个不可扩展的 target 的自身属性中不存在的属性。
  • - All references to SameValue are according to the definition of the SameValue algorithm. + 所有对 SameValue 的引用都是根据 SameValue 算法定义的。

[[GetPrototypeOf]] ( )

  • - The Type of the return value must be either Object or Null. + 返回的类型必须是 Object 或者 Null。
  • - If target is non-extensible, and [[GetPrototypeOf]] returns a value v, then any future calls to [[GetPrototypeOf]] should return the SameValue as v. + 如果 target 是不可扩展的,并且 [[GetPrototypeOf]] 返回了一个值 v,那么任何将来对 [[GetPrototypeOf]] 的调用都应该返回与 v 相同的 SameValue。
-

An object's prototype chain should have finite length (that is, starting from any object, recursively applying the [[GetPrototypeOf]] internal method to its result should eventually lead to the value null). However, this requirement is not enforceable as an object level invariant if the prototype chain includes any exotic objects that do not use the ordinary object definition of [[GetPrototypeOf]]. Such a circular prototype chain may result in infinite loops when accessing object properties.

+

对象的原型链的长度应该是有限的(也就是说,从任意对象开始,递归地对结果应用 [[GetPrototypeOf]] 内置方法最终应该得到 null)。但是,如果原型链包含任何不使用 [[GetPrototypeOf]] 的普通对象定义的奇异对象,则此要求不强制作为对象级不变量。这样的环形原型链可能会在访问对象属性时产生无限循环。

[[SetPrototypeOf]] (_V_)

  • - The Type of the return value must be Boolean. + 返回的类型必须是 Boolean。
  • - If target is non-extensible, [[SetPrototypeOf]] must return false, unless V is the SameValue as the target's observed [[GetPrototypeOf]] value. + 如果 target 是不可扩展的,[[SetPrototypeOf]] 必须返回 false,除非 V 与 target 执行 [[GetPrototypeOf]] 内置方法的 SameValue 相同。

[[IsExtensible]] ( )

  • - The Type of the return value must be Boolean. + 返回的类型必须是 Boolean。
  • - If [[IsExtensible]] returns false, all future calls to [[IsExtensible]] on the target must return false. + 如果 [[IsExtensible]] 返回 false,所有将来对 target 的 [[IsExtensible]] 内置方法调用都必须返回 false。

[[PreventExtensions]] ( )

  • - The Type of the return value must be Boolean. + 返回的类型必须是 Boolean。
  • - If [[PreventExtensions]] returns true, all future calls to [[IsExtensible]] on the target must return false and the target is now considered non-extensible. + 如果 [[PreventExtensions]] 返回 false,所有将来对 target 的 [[IsExtensible]] 内置方法的的调用都必须返回 false,并且此刻开始 target 被认为是不可扩展的。

[[GetOwnProperty]] (_P_)

  • - The Type of the return value must be either Property Descriptor or Undefined. + 返回的类型必须是 Property Descriptor 或者 Undefined。
  • - If the Type of the return value is Property Descriptor, the return value must be a complete property descriptor (see ). + 如果返回的类型是 Property Descriptor,那么返回值必须是一个完整的 property descriptor (见)。
  • - If a property P is described as a data property with Desc.[[Value]] equal to v and Desc.[[Writable]] and Desc.[[Configurable]] are both false, then the SameValue must be returned for the Desc.[[Value]] attribute of the property on all future calls to [[GetOwnProperty]] ( P ). + 一个属性 P 被数据属性 Desc 描述,如果 Desc.[[Value]] 等于 v,且 Desc.[[Writable]] 以及 Desc.[[Configurable]] 都为 false,那么所有将来调用 [[GetOwnProperty]](P) 内置方法时,返回的 SameValue 必须是属性的 Desc.[[Value]]。
  • - If P's attributes other than [[Writable]] may change over time or if the property might disappear, then P's [[Configurable]] attribute must be true. + 如果 P 属性除了 [[Writable]] 特性,其他特性在将来可能变化,或者属性可能消失,那么 P 的 [[Configurable]] 特性必须为 true。
  • - If the [[Writable]] attribute may change from false to true, then the [[Configurable]] attribute must be true. + 如果 P 属性的 [[Writable]] 特性可能从 false 变为 true,那么 [[Configurable]] 特性必须为 true。
  • - If the target is non-extensible and P is non-existent, then all future calls to [[GetOwnProperty]] (P) on the target must describe P as non-existent (i.e. [[GetOwnProperty]] (P) must return undefined). + 如果对象是不可扩展的且 P 属性不存在,那么将来所有对 target 的 [[GetOwnProperty]] (P) 内置方法的调用必须描述 P 属性不存在(即 [[GetOwnProperty]] (P) 必须返回 undefined)。
-

As a consequence of the third invariant, if a property is described as a data property and it may return different values over time, then either or both of the Desc.[[Writable]] and Desc.[[Configurable]] attributes must be true even if no mechanism to change the value is exposed via the other internal methods.

+

作为第三个不变量的推论,如果一个属性被描述为一个数据属性并且随着时间它可能返回不同的值,那么 Desc.[[Writable]] 和 Desc.[[Configurable]] 特性必须是 true,虽然没有机制通过其它内置方法去改变暴露出来的值。

[[DefineOwnProperty]] (_P_, _Desc_)

  • - The Type of the return value must be Boolean. + 返回的类型必须是 Boolean。
  • -

    [[DefineOwnProperty]] must return false if P has previously been observed as a non-configurable own property of the target, unless either:

    +

    + 如果 P 预先已经作为 target 的一个不可配置的自身属性被观察,那么 [[DefineOwnProperty]] 必须返回 false,除非满足一下条件之一: +

    1. - P is a non-configurable writable own data property. A non-configurable writable data property can be changed into a non-configurable non-writable data property. + P 是一个不可配置的可写数据属性。一个不可配置的可写数据属性可以被转换为一个不可配置不可写的数据属性。
    2. - All attributes in Desc are the SameValue as P's attributes. + Desc 中的所有特性都是作为 P 属性特性的 SameValue。
  • - [[DefineOwnProperty]] (P, Desc) must return false if target is non-extensible and P is a non-existent own property. That is, a non-extensible target object cannot be extended with new properties. + 如果 target 是不可配置的且 P 属性不存在,那么 [[DefineOwnProperty]] (P, Desc) 必须返回 false。也就是说,一个不可配置的 target 对象不能扩展新属性。

[[HasProperty]] ( _P_ )

  • - The Type of the return value must be Boolean. + 返回的类型必须是 Boolean。
  • - If P was previously observed as a non-configurable data or accessor own property of the target, [[HasProperty]] must return true. + 如果 target 自身属性 P 预先已经作为一个不可配置的数据属性或者访问器属性被观察,[[HasProperty]] 必须返回 true。

[[Get]] (_P_, _Receiver_)

  • - If P was previously observed as a non-configurable, non-writable own data property of the target with value v, then [[Get]] must return the SameValue. + 如果 P,其值为 V,预先作为一个不可配置,不可写的 target 自身属性被观察,那么 [[GET]] 必须返回 SameValue。
  • - If P was previously observed as a non-configurable own accessor property of the target whose [[Get]] attribute is undefined, the [[Get]] operation must return undefined. + 如果 P,其 [[Get]] 特性为 undefined,预先作为一个不可配置的 target 自身访问器属性被观察,那么 [[Get]] 操作必须返回 undefined。

[[Set]] ( _P_, _V_, _Receiver_)

  • - The Type of the return value must be Boolean. + 返回的类型必须是 Boolean。
  • - If P was previously observed as a non-configurable, non-writable own data property of the target, then [[Set]] must return false unless V is the SameValue as P's [[Value]] attribute. + 如果 P 预先作为一个不可配置,不可写的 target 自身数据属性被观察,那么 [[Set]] 必须返回 false。除非 V 是 P 的 [[Value]] 特性的 SameValue。
  • - If P was previously observed as a non-configurable own accessor property of the target whose [[Set]] attribute is undefined, the [[Set]] operation must return false. + 如果 P,其 [[Set]] 特性为 undefined,预先作为一个不可配置的 target 自身访问器属性被观察,那么 [[Set]] 操作必须返回 false。

[[Delete]] ( _P_ )

  • - The Type of the return value must be Boolean. + 返回的类型必须是 Boolean。
  • - If P was previously observed to be a non-configurable own data or accessor property of the target, [[Delete]] must return false. + 如果 P 预先作为一个不可配置的 target 自身数据或访问器属性被观察,那么 [[Delete]] 必须返回 false。

[[OwnPropertyKeys]] ( )

  • - The return value must be a List. + 返回值必须是一个 List。
  • - The returned list must not contain any duplicate entries. + 返回的列表不能包含任何重复的元素。
  • - The Type of each element of the returned List is either String or Symbol. + 返回的 List 的每个元素类型为 String 或者 Symbol。
  • - The returned List must contain at least the keys of all non-configurable own properties that have previously been observed. + 返回的 List 必须包含至少预先已经被观察的自身属性的所有不可配置的 key。
  • - If the object is non-extensible, the returned List must contain only the keys of all own properties of the object that are observable using [[GetOwnProperty]]. + 如果对象是不可扩展的,那么返回的 List 必须只包含使用 [[GetOwnProperty]] 观察的对象所有属性的 key。

[[Construct]] ( )

  • - The Type of the return value must be Object. + 返回值类型必须是 Object。
-

Well-Known Intrinsic Objects

-

Well-known intrinsics are built-in objects that are explicitly referenced by the algorithms of this specification and which usually have realm-specific identities. Unless otherwise specified each intrinsic object actually corresponds to a set of similar objects, one per realm.

-

Within this specification a reference such as %name% means the intrinsic object, associated with the current realm, corresponding to the name. Determination of the current realm and its intrinsics is described in . The well-known intrinsics are listed in .

- +

著名内部对象

+

著名内联函数是在该规范中通过算法明确引用的内置对象,这些内置对象通常有特定域的不变量。除非特别指出,每个内部对象在每个领域通常对应一系列相似对象的集合。

+

在本规范中像 %name% 这样的引用意味着关联到相应的 name 域的内部对象。决定当前域以及他的内联函数在描述。著名内联函数在表列出。 +

+ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
- Intrinsic Name - - Global Name - - ECMAScript Language Association -
- %Array% - - `Array` - - The `Array` constructor () -
- %ArrayBuffer% - - `ArrayBuffer` - - The `ArrayBuffer` constructor () -
- %ArrayBufferPrototype% - - `ArrayBuffer.prototype` - - The initial value of the `prototype` data property of %ArrayBuffer%. -
- %ArrayIteratorPrototype% - - - The prototype of Array iterator objects () -
- %ArrayPrototype% - - `Array.prototype` - - The initial value of the `prototype` data property of %Array% () -
- %ArrayProto_entries% - - `Array.prototype.entries` - - The initial value of the `entries` data property of %ArrayPrototype% () -
- %ArrayProto_forEach% - - `Array.prototype.forEach` - - The initial value of the `forEach` data property of %ArrayPrototype% () -
- %ArrayProto_keys% - - `Array.prototype.keys` - - The initial value of the `keys` data property of %ArrayPrototype% () -
- %ArrayProto_values% - - `Array.prototype.values` - - The initial value of the `values` data property of %ArrayPrototype% () -
- %AsyncFunction% - - - The constructor of async function objects () -
- %AsyncFunctionPrototype% - - - The initial value of the `prototype` data property of %AsyncFunction% -
- %Atomics% - - `Atomics` - - The `Atomics` object () -
- %Boolean% - - `Boolean` - - The `Boolean` constructor () -
- %BooleanPrototype% - - `Boolean.prototype` - - The initial value of the `prototype` data property of %Boolean% () -
- %DataView% - - `DataView` - - The `DataView` constructor () -
- %DataViewPrototype% - - `DataView.prototype` - - The initial value of the `prototype` data property of %DataView% -
- %Date% - - `Date` - - The `Date` constructor () -
- %DatePrototype% - - `Date.prototype` - - The initial value of the `prototype` data property of %Date%. -
- %decodeURI% - - `decodeURI` - - The `decodeURI` function () -
- %decodeURIComponent% - - `decodeURIComponent` - - The `decodeURIComponent` function () -
- %encodeURI% - - `encodeURI` - - The `encodeURI` function () -
- %encodeURIComponent% - - `encodeURIComponent` - - The `encodeURIComponent` function () -
- %Error% - - `Error` - - The `Error` constructor () -
- %ErrorPrototype% - - `Error.prototype` - - The initial value of the `prototype` data property of %Error% -
- %eval% - - `eval` - - The `eval` function () -
- %EvalError% - - `EvalError` - - The `EvalError` constructor () -
- %EvalErrorPrototype% - - `EvalError.prototype` - - The initial value of the `prototype` data property of %EvalError% -
- %Float32Array% - - `Float32Array` - - The `Float32Array` constructor () -
- %Float32ArrayPrototype% - - `Float32Array.prototype` - - The initial value of the `prototype` data property of %Float32Array% -
- %Float64Array% - - `Float64Array` - - The `Float64Array` constructor () -
- %Float64ArrayPrototype% - - `Float64Array.prototype` - - The initial value of the `prototype` data property of %Float64Array% -
- %Function% - - `Function` - - The `Function` constructor () -
- %FunctionPrototype% - - `Function.prototype` - - The initial value of the `prototype` data property of %Function% -
- %Generator% - - - The initial value of the `prototype` data property of %GeneratorFunction% -
- %GeneratorFunction% - - - The constructor of generator objects () -
- %GeneratorPrototype% - - - The initial value of the `prototype` data property of %Generator% -
- %Int8Array% - - `Int8Array` - - The `Int8Array` constructor () -
- %Int8ArrayPrototype% - - `Int8Array.prototype` - - The initial value of the `prototype` data property of %Int8Array% -
- %Int16Array% - - `Int16Array` - - The `Int16Array` constructor () -
- %Int16ArrayPrototype% - - `Int16Array.prototype` - - The initial value of the `prototype` data property of %Int16Array% -
- %Int32Array% - - `Int32Array` - - The `Int32Array` constructor () -
- %Int32ArrayPrototype% - - `Int32Array.prototype` - - The initial value of the `prototype` data property of %Int32Array% -
- %isFinite% - - `isFinite` - - The `isFinite` function () -
- %isNaN% - - `isNaN` - - The `isNaN` function () -
- %IteratorPrototype% - - - An object that all standard built-in iterator objects indirectly inherit from -
- %JSON% - - `JSON` - - The `JSON` object () -
- %JSONParse% - - `JSON.parse` - - The initial value of the `parse` data property of %JSON% -
- %Map% - - `Map` - - The `Map` constructor () -
- %MapIteratorPrototype% - - - The prototype of Map iterator objects () -
- %MapPrototype% - - `Map.prototype` - - The initial value of the `prototype` data property of %Map% -
- %Math% - - `Math` - - The `Math` object () -
- %Number% - - `Number` - - The `Number` constructor () -
- %NumberPrototype% - - `Number.prototype` - - The initial value of the `prototype` data property of %Number% -
- %Object% - - `Object` - - The `Object` constructor () -
- %ObjectPrototype% - - `Object.prototype` - - The initial value of the `prototype` data property of %Object% () -
- %ObjProto_toString% - - `Object.prototype.toString` - - The initial value of the `toString` data property of %ObjectPrototype% () -
- %ObjProto_valueOf% - - `Object.prototype.valueOf` - - The initial value of the `valueOf` data property of %ObjectPrototype% () -
- %parseFloat% - - `parseFloat` - - The `parseFloat` function () -
- %parseInt% - - `parseInt` - - The `parseInt` function () -
- %Promise% - - `Promise` - - The `Promise` constructor () -
- %PromisePrototype% - - `Promise.prototype` - - The initial value of the `prototype` data property of %Promise% -
- %PromiseProto_then% - - `Promise.prototype.then` - - The initial value of the `then` data property of %PromisePrototype% () -
- %Promise_all% - - `Promise.all` - - The initial value of the `all` data property of %Promise% () -
- %Promise_reject% - - `Promise.reject` - - The initial value of the `reject` data property of %Promise% () -
- %Promise_resolve% - - `Promise.resolve` - - The initial value of the `resolve` data property of %Promise% () -
- %Proxy% - - `Proxy` - - The `Proxy` constructor () -
- %RangeError% - - `RangeError` - - The `RangeError` constructor () -
- %RangeErrorPrototype% - - `RangeError.prototype` - - The initial value of the `prototype` data property of %RangeError% -
- %ReferenceError% - - `ReferenceError` - - The `ReferenceError` constructor () -
- %ReferenceErrorPrototype% - - `ReferenceError.prototype` - - The initial value of the `prototype` data property of %ReferenceError% -
- %Reflect% - - `Reflect` - - The `Reflect` object () -
- %RegExp% - - `RegExp` - - The `RegExp` constructor () -
- %RegExpPrototype% - - `RegExp.prototype` - - The initial value of the `prototype` data property of %RegExp% -
- %Set% - - `Set` - - The `Set` constructor () -
- %SetIteratorPrototype% - - - The prototype of Set iterator objects () -
- %SetPrototype% - - `Set.prototype` - - The initial value of the `prototype` data property of %Set% -
- %SharedArrayBuffer% - - `SharedArrayBuffer` - - The `SharedArrayBuffer` constructor () -
- %SharedArrayBufferPrototype% - - `SharedArrayBuffer.prototype` - - The initial value of the `prototype` data property of %SharedArrayBuffer% -
- %String% - - `String` - - The `String` constructor () -
- %StringIteratorPrototype% - - - The prototype of String iterator objects () -
- %StringPrototype% - - `String.prototype` - - The initial value of the `prototype` data property of %String% -
- %Symbol% - - `Symbol` - - The `Symbol` constructor () -
- %SymbolPrototype% - - `Symbol.prototype` - - The initial value of the `prototype` data property of %Symbol% () -
- %SyntaxError% - - `SyntaxError` - - The `SyntaxError` constructor () -
- %SyntaxErrorPrototype% - - `SyntaxError.prototype` - - The initial value of the `prototype` data property of %SyntaxError% -
- %ThrowTypeError% - - - A function object that unconditionally throws a new instance of %TypeError% -
- %TypedArray% - - - The super class of all typed Array constructors () -
- %TypedArrayPrototype% - - - The initial value of the `prototype` data property of %TypedArray% -
- %TypeError% - - `TypeError` - - The `TypeError` constructor () -
- %TypeErrorPrototype% - - `TypeError.prototype` - - The initial value of the `prototype` data property of %TypeError% -
- %Uint8Array% - - `Uint8Array` - - The `Uint8Array` constructor () -
- %Uint8ArrayPrototype% - - `Uint8Array.prototype` - - The initial value of the `prototype` data property of %Uint8Array% -
- %Uint8ClampedArray% - - `Uint8ClampedArray` - - The `Uint8ClampedArray` constructor () -
- %Uint8ClampedArrayPrototype% - - `Uint8ClampedArray.prototype` - - The initial value of the `prototype` data property of %Uint8ClampedArray% -
- %Uint16Array% - - `Uint16Array` - - The `Uint16Array` constructor () -
- %Uint16ArrayPrototype% - - `Uint16Array.prototype` - - The initial value of the `prototype` data property of %Uint16Array% -
- %Uint32Array% - - `Uint32Array` - - The `Uint32Array` constructor () -
- %Uint32ArrayPrototype% - - `Uint32Array.prototype` - - The initial value of the `prototype` data property of %Uint32Array% -
- %URIError% - - `URIError` - - The `URIError` constructor () -
- %URIErrorPrototype% - - `URIError.prototype` - - The initial value of the `prototype` data property of %URIError% -
- %WeakMap% - - `WeakMap` - - The `WeakMap` constructor () -
- %WeakMapPrototype% - - `WeakMap.prototype` - - The initial value of the `prototype` data property of %WeakMap% -
- %WeakSet% - - `WeakSet` - - The `WeakSet` constructor () -
- %WeakSetPrototype% - - `WeakSet.prototype` - - The initial value of the `prototype` data property of %WeakSet% -
+ 内在名称 + + 全局名称 + + ECMAScript 语言关联 +
+ %Array% + + `Array` + + `Array` 构造函数 () +
+ %ArrayBuffer% + + `ArrayBuffer` + + `ArrayBuffer` 构造函数 () +
+ %ArrayBufferPrototype% + + `ArrayBuffer.prototype` + + %ArrayBuffer% `prototype` 数据属性的初始值 +
+ %ArrayIteratorPrototype% + + + 数组迭代器对象的原型 () +
+ %ArrayPrototype% + + `Array.prototype` + + %Array% `prototype` 数据属性的初始值 () +
+ %ArrayProto_entries% + + `Array.prototype.entries` + + %ArrayPrototype% `entries` 数据属性的初始值 () +
+ %ArrayProto_forEach% + + `Array.prototype.forEach` + + %ArrayPrototype% `forEach` 数据属性的初始值 () +
+ %ArrayProto_keys% + + `Array.prototype.keys` + + %ArrayPrototype% `keys` 数据属性的初始值 () +
+ %ArrayProto_values% + + `Array.prototype.values` + + %ArrayPrototype% `values` 数据属性的初始值 () +
+ %AsyncFunction% + + + async 函数对象的构造器 () +
+ %AsyncFunctionPrototype% + + + %AsyncFunction% `prototype` 数据属性的初始值 +
+ %Atomics% + + `Atomics` + + `Atomics` 对象 () +
+ %Boolean% + + `Boolean` + + `Boolean` 构造函数 () +
+ %BooleanPrototype% + + `Boolean.prototype` + + %Boolean% `prototype` 数据属性的初始值 () +
+ %DataView% + + `DataView` + + `DataView` 构造函数 () +
+ %DataViewPrototype% + + `DataView.prototype` + + %DataView% `prototype` 数据属性的初始值 +
+ %Date% + + `Date` + + `Date` 构造函数 () +
+ %DatePrototype% + + `Date.prototype` + + %Date% `prototype` 数据属性的初始值 +
+ %decodeURI% + + `decodeURI` + + `decodeURI` 函数 () +
+ %decodeURIComponent% + + `decodeURIComponent` + + `decodeURIComponent` 函数 () +
+ %encodeURI% + + `encodeURI` + + `encodeURI` 函数 () +
+ %encodeURIComponent% + + `encodeURIComponent` + + `encodeURIComponent` 函数 () +
+ %Error% + + `Error` + + `Error` 构造函数 () +
+ %ErrorPrototype% + + `Error.prototype` + + %Error% `prototype` 数据属性的初始值 +
+ %eval% + + `eval` + + `eval` 函数 () +
+ %EvalError% + + `EvalError` + + `EvalError` 构造函数 () +
+ %EvalErrorPrototype% + + `EvalError.prototype` + + %EvalError% `prototype` 属性的初始值 +
+ %Float32Array% + + `Float32Array` + + `Float32Array` 构造函数 () +
+ %Float32ArrayPrototype% + + `Float32Array.prototype` + + %Float32Array% `prototype` 数据属性的初始值 +
+ %Float64Array% + + `Float64Array` + + `Float64Array` 构造函数 () +
+ %Float64ArrayPrototype% + + `Float64Array.prototype` + + %Float64Array% `prototype` 数据属性的初始值 +
+ %Function% + + `Function` + + `Function` 构造函数 () +
+ %FunctionPrototype% + + `Function.prototype` + + %Function% `prototype` 数据属性的初始值 +
+ %Generator% + + + %GeneratorFunction% `prototype` 属性的初始值 +
+ %GeneratorFunction% + + + generator 对象的构造函数 () +
+ %GeneratorPrototype% + + + %Generator% `prototype` 属性的初始值 +
+ %Int8Array% + + `Int8Array` + + `Int8Array` 构造函数 () +
+ %Int8ArrayPrototype% + + `Int8Array.prototype` + + %Int8Array% `prototype` 数据属性的初始值 +
+ %Int16Array% + + `Int16Array` + + `Int16Array` 构造函数 () +
+ %Int16ArrayPrototype% + + `Int16Array.prototype` + + %Int16Array% `prototype` 数据属性的初始值 +
+ %Int32Array% + + `Int32Array` + + `Int32Array` 构造函数 () +
+ %Int32ArrayPrototype% + + `Int32Array.prototype` + + %Int32Array% `prototype` 数据属性的初始值 +
+ %isFinite% + + `isFinite` + + `isFinite` 函数 () +
+ %isNaN% + + `isNaN` + + `isNaN` 函数 () +
+ %IteratorPrototype% + + + 所有标准内置迭代对象间接继承的对象 +
+ %JSON% + + `JSON` + + `JSON` 对象 () +
+ %JSONParse% + + `JSON.parse` + + %JSON% `parse` 数据属性的初始值 +
+ %Map% + + `Map` + + `Map` 构造函数 () +
+ %MapIteratorPrototype% + + + Map 迭代器对象的原型 () +
+ %MapPrototype% + + `Map.prototype` + + %Map% `prototype` 数据属性的初始值 +
+ %Math% + + `Math` + + `Math` 对象 () +
+ %Number% + + `Number` + + `Number` 构造函数 () +
+ %NumberPrototype% + + `Number.prototype` + + %Number% `prototype` 属性的初始值 +
+ %Object% + + `Object` + + `Object` 构造函数 () +
+ %ObjectPrototype% + + `Object.prototype` + + %Object%. () `prototype` 数据属性的初始值 +
+ %ObjProto_toString% + + `Object.prototype.toString` + + %ObjectPrototype% () `toString` 数据属性的初始值 +
+ %ObjProto_valueOf% + + `Object.prototype.valueOf` + + %ObjectPrototype% () `valueOf` 数据属性的初始值 +
+ %parseFloat% + + `parseFloat` + + `parseFloat` 函数 () +
+ %parseInt% + + `parseInt` + + `parseInt` 函数 () +
+ %Promise% + + `Promise` + + `Promise` 构造函数 () +
+ %PromisePrototype% + + `Promise.prototype` + + %Promise% `prototype` 数据属性的初始值 +
+ %PromiseProto_then% + + `Promise.prototype.then` + + The initial value of the `then` data property of %PromisePrototype% () +
+ %Promise_all% + + `Promise.all` + + The initial value of the `all` data property of %Promise% () +
+ %Promise_reject% + + `Promise.reject` + + The initial value of the `reject` data property of %Promise% () +
+ %Promise_resolve% + + `Promise.resolve` + + The initial value of the `resolve` data property of %Promise% () +
+ %Proxy% + + `Proxy` + + `Proxy` 构造函数 () +
+ %RangeError% + + `RangeError` + + `RangeError` 构造函数 () +
+ %RangeErrorPrototype% + + `RangeError.prototype` + + %RangeError% `prototype` 属性的初始值 +
+ %ReferenceError% + + `ReferenceError` + + `ReferenceError` 构造函数 () +
+ %ReferenceErrorPrototype% + + `ReferenceError.prototype` + + %ReferenceError% `prototype` 属性的初始值 +
+ %Reflect% + + `Reflect` + + `Reflect` 对象 () +
+ %RegExp% + + `RegExp` + + `RegExp` 构造函数 () +
+ %RegExpPrototype% + + `RegExp.prototype` + + %RegExp% `prototype` 数据属性的初始值 +
+ %Set% + + `Set` + + `Set` 构造函数 () +
+ %SetIteratorPrototype% + + + Set 迭代器对象的原型 () +
+ %SetPrototype% + + `Set.prototype` + + %Set% `prototype` 数据属性的初始值 +
+ %SharedArrayBuffer% + + `SharedArrayBuffer` + + `SharedArrayBuffer` 构造函数 () +
+ %SharedArrayBufferPrototype% + + `SharedArrayBuffer.prototype` + + %SharedArrayBuffer% `prototype` 数据属性的初始值 +
+ %String% + + `String` + + `String` 构造函数 () +
+ %StringIteratorPrototype% + + + String 迭代器对象的原型 () +
+ %StringPrototype% + + `String.prototype` + + %String% `prototype` 数据属性的初始值 +
+ %Symbol% + + `Symbol` + + `Symbol` 构造函数 () +
+ %SymbolPrototype% + + `Symbol.prototype` + + %Symbol% `prototype` 数据属性的初始值 () +
+ %SyntaxError% + + `SyntaxError` + + `SyntaxError` 构造函数 () +
+ %SyntaxErrorPrototype% + + `SyntaxError.prototype` + + %SyntaxError% `prototype` 属性的初始值 +
+ %ThrowTypeError% + + + 一个函数对象,无条件的抛出一个新 %TypeError% 实例 +
+ %TypedArray% + + + 所有数组类型构造器的超类 () +
+ %TypedArrayPrototype% + + + %TypedArray% `prototype 属性的初始值 +
+ %TypeError% + + `TypeError` + + `TypeError` 构造函数 () +
+ %TypeErrorPrototype% + + `TypeError.prototype` + + %TypeError% `prototype` 属性的初始值 +
+ %Uint8Array% + + `Uint8Array` + + `Uint8Array` 构造函数 () +
+ %Uint8ArrayPrototype% + + `Uint8Array.prototype` + + %Uint8Array% `prototype` 数据属性的初始值 +
+ %Uint8ClampedArray% + + `Uint8ClampedArray` + + `Uint8ClampedArray` 构造函数 () +
+ %Uint8ClampedArrayPrototype% + + `Uint8ClampedArray.prototype` + + %Uint8ClampedArray% `prototype` 数据属性的初始值 +
+ %Uint16Array% + + `Uint16Array` + + `Uint16Array` 构造函数 () +
+ %Uint16ArrayPrototype% + + `Uint16Array.prototype` + + %Uint16Array% `prototype` 数据属性的初始值 +
+ %Uint32Array% + + `Uint32Array` + + `Uint32Array` 构造函数 () +
+ %Uint32ArrayPrototype% + + `Uint32Array.prototype` + + %Uint32Array% `prototype` 数据属性的初始值 +
+ %URIError% + + `URIError` + + `URIError` 构造函数 () +
+ %URIErrorPrototype% + + `URIError.prototype` + + %URIError% `prototype` 属性的初始值 +
+ %WeakMap% + + `WeakMap` + + `WeakMap` 构造函数 () +
+ %WeakMapPrototype% + + `WeakMap.prototype` + + %WeakMap% `prototype` 数据属性的初始值 +
+ %WeakSet% + + `WeakSet` + + `WeakSet` 构造函数 () +
+ %WeakSetPrototype% + + `WeakSet.prototype` + + %WeakSet% `prototype` 数据属性的初始值 +