diff --git a/translated/issues-10.html b/translated/issues-10.html index cc8f835841..245c967831 100644 --- a/translated/issues-10.html +++ b/translated/issues-10.html @@ -1,116 +1,116 @@ -

ECMAScript Specification Types

-

A specification type corresponds to meta-values that are used within algorithms to describe the semantics of ECMAScript language constructs and ECMAScript language types. The specification types include Reference, List, Completion, Property Descriptor, Lexical Environment, Environment Record, and Data Block. Specification type values are specification artefacts that do not necessarily correspond to any specific entity within an ECMAScript implementation. Specification type values may be used to describe intermediate results of ECMAScript expression evaluation but such values cannot be stored as properties of objects or values of ECMAScript language variables.

+

ECMAScript规范类型

+

规范类型对应那些在算法中用来描述 ECMAScript 语言结构以及 ECMAScript 语言类型语义的元数据。 规范类型包括 Reference,List,Completion,Property Descriptor,Lexical Environment,Environment Record,以及 Data Block。规范类型值是规范中才有的,在一个 ECMAScript 实现中不必对应任何特定的实体。规范类型值可以用来描述 ECMAScript 表达式解析后的中间结果,但是这些值不应该作为 ECMAScript 变量的对象属性或者值储存。

-

The List and Record Specification Types

-

The List type is used to explain the evaluation of argument lists (see ) in `new` expressions, in function calls, and in other algorithms where a simple ordered list of values is needed. Values of the List type are simply ordered sequences of list elements containing the individual values. These sequences may be of any length. The elements of a list may be randomly accessed using 0-origin indices. For notational convenience an array-like syntax can be used to access List elements. For example, _arguments_[2] is shorthand for saying the 3rd element of the List _arguments_.

-

For notational convenience within this specification, a literal syntax can be used to express a new List value. For example, « 1, 2 » defines a List value that has two elements each of which is initialized to a specific value. A new empty List can be expressed as « ».

-

The Record type is used to describe data aggregations within the algorithms of this specification. A Record type value consists of one or more named fields. The value of each field is either an ECMAScript value or an abstract value represented by a name associated with the Record type. Field names are always enclosed in double brackets, for example [[Value]].

-

For notational convenience within this specification, an object literal-like syntax can be used to express a Record value. For example, {[[Field1]]: 42, [[Field2]]: *false*, [[Field3]]: ~empty~} defines a Record value that has three fields, each of which is initialized to a specific value. Field name order is not significant. Any fields that are not explicitly listed are considered to be absent.

-

In specification text and algorithms, dot notation may be used to refer to a specific field of a Record value. For example, if R is the record shown in the previous paragraph then R.[[Field2]] is shorthand for “the field of R named [[Field2]]”.

-

Schema for commonly used Record field combinations may be named, and that name may be used as a prefix to a literal Record value to identify the specific kind of aggregations that is being described. For example: PropertyDescriptor{[[Value]]: 42, [[Writable]]: *false*, [[Configurable]]: *true*}.

+

List 以及 Record 规范类型

+

List 类型用来解释在 `new` 表达式,函数调用,以及其它需要一个简单的有序的值的 list 的算法中的参数列表(见)的求值,List 类型的值是包含单个值的列表元素的简单有序序列。这些序列可能是任意长度。列表的元素可以通过使用从 0 开始的索引随机访问。为了方便起见,可以使用类似数组的语法来访问 List 元素。 例如,_arguments_[2] 简短的表示 _arguments_ List 的第三个元素。

+

在规范中为了方便,一个字面量语法被用来表达一个新 List 值。 如 « 1, 2 » 定义一个新 List 值,它拥有两个元素,每个元素被初始化为一个特定的值。一个空的 List 值可以用 « » 表示。

+

Record 类型用来描述在该规范中的算法内的数据聚合。一个 Record 类型值包含一个或多个命名字段。每个字段的值是一个 ECMAScript 值或者通过由与 Record 类型相关联的名称代表的抽象值。字段名称始终用双括号括起来,例如 [[Value]]。

+

在规范中为了方便,使用类似对象字面量的语法来表示一个 Record 值。 如 {[[Field1]]: 42, [[Field2]]: `false`, [[Field3]]: ~empty~} 定义一个拥有3个字段的 Record 值。每个字段被初始化为一个特定的值。字段名称顺序不重要。任何未明确列出的字段都被视为不存在。

+

在规范文本和算法中,点记号可以用于指代记录值的特定字段。例如,如果 R 是上一段所示的记录,则 R.[[Field2]] 是 “R 中名称为 [[Field2]] 的字段 ” 的缩写。

+

应该命名常用记录字段组合的模式, 并且该名称可以用作Record字面量的前缀,以标识特定类型聚合的描述。 例如:PropertyDescriptor{[[Value]]: 42,[[Writable]]: `false`,[[Configurable]]: `true`}。

-

The Set and Relation Specification Types

-

The Set type is used to explain a collection of unordered elements for use in the memory model. Values of the Set type are simple collections of elements, where no element appears more than once. Elements may be added to and removed from Sets. Sets may be unioned, intersected, or subtracted from each other.

-

The Relation type is used to explain constraints on Sets. Values of the Relation type are Sets of ordered pairs of values from its value domain. For example, a Relation on events is a set of ordered pairs of events. For a Relation _R_ and two values _a_ and _b_ in the value domain of _R_, _a_ _R_ _b_ is shorthand for saying the ordered pair (_a_, _b_) is a member of _R_. A Relation is least with respect to some conditions when it is the smallest Relation that satisfies those conditions.

-

A strict partial order is a Relation value _R_ that satisfies the following.

+

Set 和 Relation 规范类型

+

Set 类型被用来解释在内存模型中无序元素的集合。Set 类型的值是简单的元素的集合,其中没有任何元素出现超过一次。元素可以从 Set 中添加或者删除。不同的 Set 可以合并,相交或者相减。

+

Relation 类型被用来解释在 Set 上的约束。一个关系类型的值是它的的值域中有序对的集合。例如,一个在 event 上的关系是一个有序的的 event 对的集合。对于一个关系 _R_ 以及在 _R_ 的值域中的两个值 _a_ 和 _b_,_a_ _R_ _b_ 是有序对 (_a_, _b_) 是 _R_ 的成员的简写。当 Relation 满足这些条件的最小 Relation 时,Relation 对于某些条件是最小的。

+

严格偏序是指一个 Relation 值 _R_ 满足如下条件。

-

The two properties above are called, in order, irreflexivity and transitivity.

+

上述两种关系的特性被称为自反性和传递性。

-

A strict total order is a Relation value _R_ that satisfies the following.

+

严格全序是指一个 Relation 值 _R_ 满足如下条件。

-

The three properties above are called, in order, totality, irreflexivity, and transitivity.

+

上述三种关系的特性,按顺序被称为完全性,自反性,传递性

-

The Completion Record Specification Type

-

The Completion type is a Record used to explain the runtime propagation of values and control flow such as the behaviour of statements (`break`, `continue`, `return` and `throw`) that perform nonlocal transfers of control.

-

Values of the Completion type are Record values whose fields are defined as by . Such values are referred to as Completion Records.

+

Completion Record 规范类型

+

Completion 类型是一个用来解释运行时数值和控制流传播的 Record,如执行非局部转移控制语句(`break`,`continue`,`return` 和 `throw`)的行为。

+

Completion 类型值是字段名为表中的Record值。这些值被称为Completion Record

- - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + +
- Field Name - - Value - - Meaning -
- [[Type]] - - One of ~normal~, ~break~, ~continue~, ~return~, or ~throw~ - - The type of completion that occurred. -
- [[Value]] - - any ECMAScript language value or ~empty~ - - The value that was produced. -
- [[Target]] - - any ECMAScript string or ~empty~ - - The target label for directed control transfers. -
+ 字段名 + + 值 + + 意义 +
+ [[Type]] + + ~normal~,~break~,~continue~,~return~,~throw~ 之一 + + 结束发生的完成类型 +
+ [[Value]] + + 任何 ECMAScript 语言值或 ~empty~ + + 产生的值 +
+ [[Target]] + + 任何 ECMAScript 字符串或 ~empty~ + + 用于定向控制传输的目标标签。 +
-

The term “abrupt completion” refers to any completion with a [[Type]] value other than ~normal~.

+

术语 “异常结束” 是指 [[Type]] 值为除 ~normal~ 之外的值。

NormalCompletion

-

The abstract operation NormalCompletion with a single _argument_, such as:

+

抽象操作 NormalCompletion 具有单一 _argument_,如:

1. Return NormalCompletion(_argument_). -

Is a shorthand that is defined as follows:

+

是下面定义的简写:

1. Return Completion{[[Type]]: ~normal~, [[Value]]: _argument_, [[Target]]: ~empty~}. @@ -119,7 +119,7 @@

NormalCompletion

UpdateEmpty ( _completionRecord_, _value_ )

-

The abstract operation UpdateEmpty with arguments _completionRecord_ and _value_ performs the following steps:

+

抽象操作 UpdateEmpty 有参数 _completionRecord_ 和_value_,他的执行步骤如下:

1. Assert: If _completionRecord_.[[Type]] is either ~return~ or ~throw~, then _completionRecord_.[[Value]] is not ~empty~. 1. If _completionRecord_.[[Value]] is not ~empty~, return Completion(_completionRecord_). @@ -130,13 +130,13 @@

UpdateEmpty ( _completionRecord_, _value_ )

-

The Reference Specification Type

+

Reference 规范类型

-

The Reference type is used to explain the behaviour of such operators as `delete`, `typeof`, the assignment operators, the `super` keyword and other language features. For example, the left-hand operand of an assignment is expected to produce a reference.

+

Reference 类型用于解释如 `delete`,`typeof`,分配操作,`super` 关键字以及其他语言功能的操作的行为。例如,分配一个左操作数预计将产生一个引用

-

A Reference is a resolved name or property binding. A Reference consists of three components, the base value component, the referenced name component, and the Boolean-valued strict reference flag. The base value component is either *undefined*, an Object, a Boolean, a String, a Symbol, a Number, or an Environment Record. A base value component of *undefined* indicates that the Reference could not be resolved to a binding. The referenced name component is a String or Symbol value.

-

A Super Reference is a Reference that is used to represents a name binding that was expressed using the super keyword. A Super Reference has an additional thisValue component, and its base value component will never be an Environment Record.

-

The following abstract operations are used in this specification to operate on references:

+

一个 Reference 是一个解析后的名称或者属性组合。一个 Reference 包含3个组件,基值组件,引用名组件,以及一个 Boolean 值的严格引用标志。一个基值组件可以是 *undefined*,Object, Boolean,String,Symbol,Number, 或 Environment Record。一个基值组件为 *undefined* 表示 Reference 解析为一个组合。引用名组件是一个 String,或 Symbol。

+

一个 Super Reference 是指,用于表示使用 super 关键字表示一个名称组合的 Reference。一个 Super Reference 有一个额外的 thisValue 组件,且他的基值组件永远不会是一个 Environment Record。

+

以下抽象操作在本规范中用于操作引用:

GetBase ( _V_ )

@@ -211,7 +211,7 @@

GetValue ( _V_ )

1. Return ? _base_.GetBindingValue(GetReferencedName(_V_), IsStrictReference(_V_)) (see ).
-

The object that may be created in step 5.a.ii is not accessible outside of the above abstract operation and the ordinary object [[Get]] internal method. An implementation might choose to avoid the actual creation of the object.

+

在步骤 5.a.ii 中创建的对象在上面抽象方法和普通对象 [[GET]] 内部方法 之外是不可访问的。实现可以选择避免实际创建对象。

@@ -221,25 +221,25 @@

PutValue ( _V_, _W_ )

1. ReturnIfAbrupt(_V_). 1. ReturnIfAbrupt(_W_). - 1. If Type(_V_) is not Reference, throw a *ReferenceError* exception. + 1. If Type(_V_) is not Reference, throw a `ReferenceError` exception. 1. Let _base_ be GetBase(_V_). - 1. If IsUnresolvableReference(_V_) is *true*, then - 1. If IsStrictReference(_V_) is *true*, then - 1. Throw a *ReferenceError* exception. + 1. If IsUnresolvableReference(_V_) is `true`, then + 1. If IsStrictReference(_V_) is `true`, then + 1. Throw a `ReferenceError` exception. 1. Let _globalObj_ be GetGlobalObject(). - 1. Return ? Set(_globalObj_, GetReferencedName(_V_), _W_, *false*). - 1. Else if IsPropertyReference(_V_) is *true*, then - 1. If HasPrimitiveBase(_V_) is *true*, then - 1. Assert: In this case, _base_ will never be *undefined* or *null*. + 1. Return ? Set(_globalObj_, GetReferencedName(_V_), _W_, `false`). + 1. Else if IsPropertyReference(_V_) is `true`, then + 1. If HasPrimitiveBase(_V_) is `true`, then + 1. Assert: In this case, _base_ will never be `undefined` or `null`. 1. Set _base_ to ! ToObject(_base_). 1. Let _succeeded_ be ? _base_.[[Set]](GetReferencedName(_V_), _W_, GetThisValue(_V_)). - 1. If _succeeded_ is *false* and IsStrictReference(_V_) is *true*, throw a *TypeError* exception. + 1. If _succeeded_ is `false` and IsStrictReference(_V_) is `true`, throw a `TypeError` exception. 1. Return. 1. Else _base_ must be an Environment Record, 1. Return ? _base_.SetMutableBinding(GetReferencedName(_V_), _W_, IsStrictReference(_V_)) (see ). -

The object that may be created in step 6.a.ii is not accessible outside of the above algorithm and the ordinary object [[Set]] internal method. An implementation might choose to avoid the actual creation of that object.

+

在步骤 6.a.ii 中创建的对象在上面抽象方法和普通对象 [[SET]] 内部方法 之外是不可访问的。实现可以选择避免实际创建对象。

@@ -271,26 +271,26 @@

InitializeReferencedBinding ( _V_, _W_ )

-

The Property Descriptor Specification Type

-

The Property Descriptor type is used to explain the manipulation and reification of Object property attributes. Values of the Property Descriptor type are Records. Each field's name is an attribute name and its value is a corresponding attribute value as specified in . In addition, any field may be present or absent. The schema name used within this specification to tag literal descriptions of Property Descriptor records is “PropertyDescriptor”.

-

Property Descriptor values may be further classified as data Property Descriptors and accessor Property Descriptors based upon the existence or use of certain fields. A data Property Descriptor is one that includes any fields named either [[Value]] or [[Writable]]. An accessor Property Descriptor is one that includes any fields named either [[Get]] or [[Set]]. Any Property Descriptor may have fields named [[Enumerable]] and [[Configurable]]. A Property Descriptor value may not be both a data Property Descriptor and an accessor Property Descriptor; however, it may be neither. A generic Property Descriptor is a Property Descriptor value that is neither a data Property Descriptor nor an accessor Property Descriptor. A fully populated Property Descriptor is one that is either an accessor Property Descriptor or a data Property Descriptor and that has all of the fields that correspond to the property attributes defined in either or .

-

The following abstract operations are used in this specification to operate upon Property Descriptor values:

+

Property Descriptor 规范类型

+

Property Descriptor 类型用来解释对象属性的特性的操作和具体化。Property Descriptor 的值为 Record 类型。每个字段的名称都是一个特性名称,其值是 相应的特性值。另外,任何字段都可以存在或不存在。在本规范中用于标记 Property Descriptor 记录的字面量描述是 “PropertyDescriptor”。

+

Property Descriptor 值可以根据某些字段的存在或使用进一步分类为数据 Property Descriptor 和访问器 Property Descriptor。包含字段 [[Value]] 或 [[Writable]] 的是数据 Property Descriptor。包含字段 [[Get]] 或 [[Set]] 的是访问器 Property Descriptor。所有的 Property Descriptor 都可能包含 [[Enumerable]],[[Configurable]] 字段名。一个 Property Descriptor 值可能不会同时为一个数据 Property Descriptor 和一个访问器 Property Descriptor。然而,也不一定,一个通用 Property Descriptor 是一个既不是数据 Property Descriptor 也不是访问器 Property Descriptor 的 Property Descriptor值。一个完全填充的 Property Descriptor 既是一个数据 Property Descriptor 也是一个访问器 Property Descriptor, 他有所有符合表 定义的属性特性字段。

+

在本规范中使用以下抽象操作用来操作 Property Descriptor值:

IsAccessorDescriptor ( _Desc_ )

-

When the abstract operation IsAccessorDescriptor is called with Property Descriptor _Desc_, the following steps are taken:

+

当用 Property Descriptor _Desc_ 作为参数调用抽象操作 IsAccessorDescriptor 时,采取以下步骤:

- 1. If _Desc_ is *undefined*, return *false*. - 1. If both _Desc_.[[Get]] and _Desc_.[[Set]] are absent, return *false*. - 1. Return *true*. + 1. If _Desc_ is `undefined`, return `false`. + 1. If both _Desc_.[[Get]] and _Desc_.[[Set]] are absent, return `false`. + 1. Return `true`.

IsDataDescriptor ( _Desc_ )

-

When the abstract operation IsDataDescriptor is called with Property Descriptor _Desc_, the following steps are taken:

+

当用 Property Descriptor _Desc_ 作为参数调用抽象操作 IsDataDescriptor 时,采取以下步骤:

1. If _Desc_ is *undefined*, return *false*. 1. If both _Desc_.[[Value]] and _Desc_.[[Writable]] are absent, return *false*. @@ -301,18 +301,18 @@

IsDataDescriptor ( _Desc_ )

IsGenericDescriptor ( _Desc_ )

-

When the abstract operation IsGenericDescriptor is called with Property Descriptor _Desc_, the following steps are taken:

+

当用 Property Descriptor _Desc_ 作为参数调用抽象操作 IsGenericDescriptor 时,采取以下步骤:

- 1. If _Desc_ is *undefined*, return *false*. - 1. If IsAccessorDescriptor(_Desc_) and IsDataDescriptor(_Desc_) are both *false*, return *true*. - 1. Return *false*. + 1. If _Desc_ is `undefined`, return `false`. + 1. If IsAccessorDescriptor(_Desc_) and IsDataDescriptor(_Desc_) are both `false`, return `true`. + 1. Return `false`.

FromPropertyDescriptor ( _Desc_ )

-

When the abstract operation FromPropertyDescriptor is called with Property Descriptor _Desc_, the following steps are taken:

+

当用Property Descriptor _Desc_作为参数调用抽象操作 FromPropertyDescriptor 时,采取以下步骤:

1. If _Desc_ is *undefined*, return *undefined*. 1. Let _obj_ be ObjectCreate(%ObjectPrototype%). @@ -337,7 +337,7 @@

FromPropertyDescriptor ( _Desc_ )

ToPropertyDescriptor ( _Obj_ )

-

When the abstract operation ToPropertyDescriptor is called with object _Obj_, the following steps are taken:

+

当用一个对象 _Obj_ 作为参数调用抽象操作 ToPropertyDescriptor 时,采取以下步骤:

1. If Type(_Obj_) is not Object, throw a *TypeError* exception. 1. Let _desc_ be a new Property Descriptor that initially has no fields. @@ -376,7 +376,7 @@

ToPropertyDescriptor ( _Obj_ )

CompletePropertyDescriptor ( _Desc_ )

-

When the abstract operation CompletePropertyDescriptor is called with Property Descriptor _Desc_, the following steps are taken:

+

当用 Property Descriptor _Desc_ 作为参数调用抽象操作 CompletePropertyDescriptor 时,采取以下步骤:

1. Assert: _Desc_ is a Property Descriptor. 1. Let _like_ be Record{[[Value]]: *undefined*, [[Writable]]: *false*, [[Get]]: *undefined*, [[Set]]: *undefined*, [[Enumerable]]: *false*, [[Configurable]]: *false*}. @@ -395,24 +395,24 @@

CompletePropertyDescriptor ( _Desc_ )

-

The Lexical Environment and Environment Record Specification Types

-

The Lexical Environment and Environment Record types are used to explain the behaviour of name resolution in nested functions and blocks. These types and the operations upon them are defined in .

+

Lexical Environment 和 Environment Record 规范类型

+

Lexical Environment and Environment Record 是用来解释在嵌套的函数和块中的名称解析行为。这些类型以及他们的操作在 中定义。

Data Blocks

-

The Data Block specification type is used to describe a distinct and mutable sequence of byte-sized (8 bit) numeric values. A Data Block value is created with a fixed number of bytes that each have the initial value 0.

-

For notational convenience within this specification, an array-like syntax can be used to access the individual bytes of a Data Block value. This notation presents a Data Block value as a 0-origined integer indexed sequence of bytes. For example, if _db_ is a 5 byte Data Block value then _db_[2] can be used to access its 3rd byte.

-

A data block that resides in memory that can be referenced from multiple agents concurrently is designated a Shared Data Block. A Shared Data Block has an identity (for the purposes of equality testing Shared Data Block values) that is address-free: it is tied not to the virtual addresses the block is mapped to in any process, but to the set of locations in memory that the block represents. Two data blocks are equal only if the sets of the locations they contain are equal; otherwise, they are not equal and the intersection of the sets of locations they contain is empty. Finally, Shared Data Blocks can be distinguished from Data Blocks.

-

The semantics of Shared Data Blocks is defined using Shared Data Block events by the memory model. Abstract operations below introduce Shared Data Block events and act as the interface between evaluation semantics and the event semantics of the memory model. The events form a candidate execution, on which the memory model acts as a filter. Please consult the memory model for full semantics.

-

Shared Data Block events are modeled by Records, defined in the memory model.

-

The following abstract operations are used in this specification to operate upon Data Block values:

+

Data Block 规范类型用来描述不同且可变的字节(8 bit)大小的数字值序列。一个 Data Block 值由初始值为 0,固定数量的字节构成。

+

在本规范中为了方便,可以使用类似数组的语法来访问一个 Data Block 值的各个字节。这些符号将 Data Block 值的这些字节表示为一个从 0 开始的索引队列。 例如,如果 _db_ 是一个 5 字节的 Data Block 值,那么 _db_[2] 可以用来访问第三字节。

+

驻留在内存中,可以被多个代理并发引用的数据块被称为 Shared Data Block。一个 Shared Data Block 有一个 空地址 的标识(目的是平等检测 Shared Data Block 值): 它不依赖于所述块在任何进程中映射到的虚拟地址,而是用该块来表示内存中的位置集合。只有当两个块包含的位置集合相等时他们才相等。否则,他们地址集合的交集为空,他们是不相等的。最后,可以从 Data Block 区分 Shared Data Blocks。

+

Shared Data Block 的语义由内存模型中的 Shared Data Block 事件来定义。下方的抽象操作介绍了 Shared Data Block 事件,以及在内存模型上解析语义和事件语义的接口的行为。事件形成了一个候选执行,内存模型扮演了一个过滤器的角色。请查看内存模型来了解完整的语义。

+

Shared Data Block 事件由 Record 建模, 通过内存模型定义。

+

下列抽象操作在本规范中用于对 Data Block 值进行操作:

CreateByteDataBlock ( _size_ )

-

When the abstract operation CreateByteDataBlock is called with integer argument _size_, the following steps are taken:

+

当用整数参数 _size_ 调用抽象操作 CreateByteDataBlock 时,采取以下步骤:

1. Assert: _size_≥0. 1. Let _db_ be a new Data Block value consisting of _size_ bytes. If it is impossible to create such a Data Block, throw a *RangeError* exception. @@ -423,7 +423,7 @@

CreateByteDataBlock ( _size_ )

CreateSharedByteDataBlock( _size_ )

-

When the abstract operation CreateSharedByteDataBlock is called with integer argument _size_, the following steps are taken:

+

当用整数参数 _size_ 调用抽象操作 CreateByteDataBlock 时,采取以下步骤:

1. Assert: _size_≥0. 1. Let _db_ be a new Shared Data Block value consisting of _size_ bytes. If it is impossible to create such a Shared Data Block, throw a *RangeError* exception. @@ -439,7 +439,7 @@

CreateSharedByteDataBlock( _size_ )

CopyDataBlockBytes ( _toBlock_, _toIndex_, _fromBlock_, _fromIndex_, _count_ )

-

When the abstract operation CopyDataBlockBytes is called, the following steps are taken:

+

当抽象操作 CreateByteDataBlock 被调用时,采取以下步骤:

1. Assert: _fromBlock_ and _toBlock_ are distinct Data Block or Shared Data Block values. 1. Assert: _fromIndex_, _toIndex_, and _count_ are integer values ≥ 0.