From b55a9a6910f1a81ca60cf5ba16d390cc356d5be2 Mon Sep 17 00:00:00 2001 From: liujiandong Date: Fri, 2 Feb 2018 23:27:42 +0800 Subject: [PATCH] translated: issue #12 --- translated/issues-12.html | 108 +++++++++++++++++++------------------- 1 file changed, 54 insertions(+), 54 deletions(-) diff --git a/translated/issues-12.html b/translated/issues-12.html index 087a646dec..be393e56f6 100644 --- a/translated/issues-12.html +++ b/translated/issues-12.html @@ -1,6 +1,6 @@

ToUint32 ( _argument_ )

-

The abstract operation ToUint32 converts _argument_ to one of 232 integer values in the range 0 through 232-1, inclusive. This abstract operation functions as follows:

+

抽象操作 ToUint32 将 _argument_ 转换为 0 到 232-1 的 232 个整数之一。该抽象操作算法如下:

1. Let _number_ be ? ToNumber(_argument_). 1. If _number_ is *NaN*, *+0*, *-0*, *+∞*, or *-∞*, return *+0*. @@ -9,19 +9,19 @@

ToUint32 ( _argument_ )

1. Return _int32bit_.
-

Given the above definition of ToUint32:

+

鉴于以上 ToUint32 的定义:

  • - Step 5 is the only difference between ToUint32 and ToInt32. + ToUint32 与ToInt32 只有第五步不同。
  • - The ToUint32 abstract operation is idempotent: if applied to a result that it produced, the second application leaves that value unchanged. + ToUint32 是等幂的: 其作用在同一个元素上产生的结果相同。
  • - ToUint32(ToInt32(_x_)) is equal to ToUint32(_x_) for all values of _x_. (It is to preserve this latter property that *+∞* and *-∞* are mapped to *+0*.) + 对于任意 _x_,ToUint32(ToInt32(_x_)) 等于 ToUint32(_x_)。 (这是为了保证 *+∞* 和 *-∞* 会被映射为 *+0*。)
  • - ToUint32 maps *-0* to *+0*. + ToUint32 把 *-0* 映射为 *+0*。
@@ -30,7 +30,7 @@

ToUint32 ( _argument_ )

ToInt16 ( _argument_ )

-

The abstract operation ToInt16 converts _argument_ to one of 216 integer values in the range -32768 through 32767, inclusive. This abstract operation functions as follows:

+

抽象操作 ToInt16 将 _argument_ 转换为 -32768 到 32767 的 216 个整数之一。这个抽象操作算法如下:

1. Let _number_ be ? ToNumber(_argument_). 1. If _number_ is *NaN*, *+0*, *-0*, *+∞*, or *-∞*, return *+0*. @@ -43,7 +43,7 @@

ToInt16 ( _argument_ )

ToUint16 ( _argument_ )

-

The abstract operation ToUint16 converts _argument_ to one of 216 integer values in the range 0 through 216-1, inclusive. This abstract operation functions as follows:

+

抽象操作 ToUint16 将 _argument_ 转换为 0 到 216-1 的 216 个整数之一。这个抽象操作算法如下:

1. Let _number_ be ? ToNumber(_argument_). 1. If _number_ is *NaN*, *+0*, *-0*, *+∞*, or *-∞*, return *+0*. @@ -52,13 +52,13 @@

ToUint16 ( _argument_ )

1. Return _int16bit_.
-

Given the above definition of ToUint16:

+

鉴于以上 ToUint16 的定义:

  • - The substitution of 216 for 232 in step 4 is the only difference between ToUint32 and ToUint16. + ToUint32 与 ToUint16 不同之处在于第四步时用 216 替换了 232
  • - ToUint16 maps *-0* to *+0*. + ToUint16 把 *-0* 映射为 *+0*.
@@ -67,7 +67,7 @@

ToUint16 ( _argument_ )

ToInt8 ( _argument_ )

-

The abstract operation ToInt8 converts _argument_ to one of 28 integer values in the range -128 through 127, inclusive. This abstract operation functions as follows:

+

抽象操作 ToInt8 负责将 _argument_ 转换为 -128 到 127 的 28 个整数之一。这个抽象操作算法如下:

1. Let _number_ be ? ToNumber(_argument_). 1. If _number_ is *NaN*, *+0*, *-0*, *+∞*, or *-∞*, return *+0*. @@ -80,7 +80,7 @@

ToInt8 ( _argument_ )

ToUint8 ( _argument_ )

-

The abstract operation ToUint8 converts _argument_ to one of 28 integer values in the range 0 through 255, inclusive. This abstract operation functions as follows:

+

抽象操作 ToUint8 负责将 _argument_ 转换为 0 到 255 的 28 个整数之一。这个抽象操作算法如下:

1. Let _number_ be ? ToNumber(_argument_). 1. If _number_ is *NaN*, *+0*, *-0*, *+∞*, or *-∞*, return *+0*. @@ -93,7 +93,7 @@

ToUint8 ( _argument_ )

ToUint8Clamp ( _argument_ )

-

The abstract operation ToUint8Clamp converts _argument_ to one of 28 integer values in the range 0 through 255, inclusive. This abstract operation functions as follows:

+

抽象操作 ToUint8Clamp 负责将 _argument_ 转换为 0 到 255 的 28 个整数之一。这个抽象操作算法如下:

1. Let _number_ be ? ToNumber(_argument_). 1. If _number_ is *NaN*, return *+0*. @@ -106,23 +106,23 @@

ToUint8Clamp ( _argument_ )

1. Return _f_.
-

Unlike the other ECMAScript integer conversion abstract operation, ToUint8Clamp rounds rather than truncates non-integer values and does not convert *+∞* to 0. ToUint8Clamp does “round half to even” tie-breaking. This differs from `Math.round` which does “round half up” tie-breaking.

+

与其他 ECMAScript 整数转换抽象操作不同。 ToUint8Clamp 对非整数值使用取整而不是截断,并且不会把 *+∞* 转换为 0。

ToString ( _argument_ )

-

The abstract operation ToString converts _argument_ to a value of type String according to :

+

抽象操作 ToString 负责将 _argument_ 转换为一个 String 类型值,如下:

@@ -130,7 +130,7 @@

ToString ( _argument_ )

Undefined @@ -138,7 +138,7 @@

ToString ( _argument_ )

Null @@ -146,8 +146,8 @@

ToString ( _argument_ )

Boolean @@ -155,7 +155,7 @@

ToString ( _argument_ )

Number @@ -163,7 +163,7 @@

ToString ( _argument_ )

String @@ -171,7 +171,7 @@

ToString ( _argument_ )

Symbol @@ -179,7 +179,7 @@

ToString ( _argument_ )

Object
- Argument Type + 参数类型 - Result + 结果
- Return `"undefined"`. + 返回 `"undefined"`.
- Return `"null"`. + 返回 `"null"`.
-

If _argument_ is *true*, return `"true"`.

-

If _argument_ is *false*, return `"false"`.

+

如果 _argument_ 是 *true*, 返回 `"true"`.

+

如果 _argument_ 是 *false*, 返回 `"false"`.

- Return NumberToString(_argument_). + 返回 NumberToString(_argument_).
- Return _argument_. + 返回 _argument_.
- Throw a *TypeError* exception. + 抛出一个 *TypeError* 异常.
-

Apply the following steps:

+

应用如下步骤:

1. Let _primValue_ be ? ToPrimitive(_argument_, hint String). 1. Return ? ToString(_primValue_). @@ -193,7 +193,7 @@

ToString ( _argument_ )

NumberToString ( _m_ )

-

The abstract operation NumberToString converts a Number _m_ to String format as follows:

+

抽象操作 NumberToString 负责将一个 Number 类型值 _m_ 转换为 String 类型,步骤如下:

1. If _m_ is *NaN*, return the String `"NaN"`. 1. If _m_ is *+0* or *-0*, return the String `"0"`. @@ -226,31 +226,31 @@

NumberToString ( _m_ )

* the code units of the decimal representation of the integer abs(_n_-1) (with no leading zeroes)
-

The following observations may be useful as guidelines for implementations, but are not part of the normative requirements of this Standard:

+

以下结论作为实现的参考可能是有用的,不过他们并不作为规范的要求。

  • - If x is any Number value other than *-0*, then ToNumber(ToString(x)) is exactly the same Number value as x. + 对于任何非 *-0* 的 Number 类型值 x,他的 ToNumber(ToString(x)) 结果恰好为 Number 值 x。
  • - The least significant digit of s is not always uniquely determined by the requirements listed in step 5. + s 的最少有效数位并不总是由第五步中的要求列表唯一确定。
-

For implementations that provide more accurate conversions than required by the rules above, it is recommended that the following alternative version of step 5 be used as a guideline:

+

对于提供了比上述转换规则更准确的实现,建议其中第五步参考下面的另一个版本:

5. Otherwise, let _n_, _k_, and _s_ be integers such that _k_ ≥ 1, 10_k_-1 ≤ _s_ < 10_k_, the Number value for _s_ × 10_n_-_k_ is _m_, and _k_ is as small as possible. If there are multiple possibilities for _s_, choose the value of _s_ for which _s_ × 10_n_-_k_ is closest in value to _m_. If there are two such possible values of _s_, choose the one that is even. Note that _k_ is the number of digits in the decimal representation of _s_ and that _s_ is not divisible by 10.
-

Implementers of ECMAScript may find useful the paper and code written by David M. Gay for binary-to-decimal conversion of floating-point numbers:

-

Gay, David M. Correctly Rounded Binary-Decimal and Decimal-Binary Conversions. Numerical Analysis, Manuscript 90-10. AT&T Bell Laboratories (Murray Hill, New Jersey). November 30, 1990. Available as +

David M. Gay 编写的二进制转换为十进制中关于浮点数的文章和代码对于 ECMAScript 实现者可能会有帮助:

+

Gay, David M. Correctly Rounded Binary-Decimal and Decimal-Binary Conversions. Numerical Analysis, Manuscript 90-10. AT&T Bell Laboratories (Murray Hill, New Jersey). November 30, 1990. 相关文章可以在
- http://ampl.com/REFS/abstracts.html#rounding. Associated code available as + http://ampl.com/REFS/abstracts.html#rounding 找到. 相关代码在
- http://netlib.sandia.gov/fp/dtoa.c and as + http://netlib.sandia.gov/fp/dtoa.c
- http://netlib.sandia.gov/fp/g_fmt.c and may also be found at the various `netlib` mirror sites.

+ http://netlib.sandia.gov/fp/g_fmt.c ,这些代码也可以在其他 `netlib` 镜像网站找到。

@@ -258,16 +258,16 @@

NumberToString ( _m_ )

ToObject ( _argument_ )

-

The abstract operation ToObject converts _argument_ to a value of type Object according to :

+

抽象操作 ToObject 负责将 _argument_ 转换为 Object 类型的值,见表

@@ -275,7 +275,7 @@

ToObject ( _argument_ )

Undefined @@ -283,7 +283,7 @@

ToObject ( _argument_ )

Null @@ -291,7 +291,7 @@

ToObject ( _argument_ )

Boolean @@ -299,7 +299,7 @@

ToObject ( _argument_ )

Number @@ -307,7 +307,7 @@

ToObject ( _argument_ )

String @@ -315,7 +315,7 @@

ToObject ( _argument_ )

Symbol @@ -323,7 +323,7 @@

ToObject ( _argument_ )

Object @@ -334,7 +334,7 @@

ToObject ( _argument_ )

ToPropertyKey ( _argument_ )

-

The abstract operation ToPropertyKey converts _argument_ to a value that can be used as a property key by performing the following steps:

+

抽象操作 ToPropertyKey 负责将 _argument_ 转换为一个可用作属性 key 的值,其步骤如下:

1. Let _key_ be ? ToPrimitive(_argument_, hint String). 1. If Type(_key_) is Symbol, then @@ -346,7 +346,7 @@

ToPropertyKey ( _argument_ )

ToLength ( _argument_ )

-

The abstract operation ToLength converts _argument_ to an integer suitable for use as the length of an array-like object. It performs the following steps:

+

抽象操作 ToLength 负责将 _argument_ 转换为一个可用作类数组的长度的整数,其步骤如下:

1. Let _len_ be ? ToInteger(_argument_). 1. If _len_ ≤ *+0*, return *+0*. @@ -356,23 +356,23 @@

ToLength ( _argument_ )

-

CanonicalNumericIndexString ( _argument_ )

-

The abstract operation CanonicalNumericIndexString returns _argument_ converted to a numeric value if it is a String representation of a Number that would be produced by ToString, or the string `"-0"`. Otherwise, it returns *undefined*. This abstract operation functions as follows:

+

CanonicalNumericIndexString ( _argument_ )

+ 如果 _argument_ 为是一可以通过 ToString 产生的数字字符串,或者是一个为 `"-0"` 的字符串,则抽象操作 CanonicalNumericIndexString 返回转换 _argument_ 得到的一个数字。否则,返回 `undefined`。这个抽象操作算法如下:

1. Assert: Type(_argument_) is String. 1. If _argument_ is `"-0"`, return *-0*. 1. Let _n_ be ! ToNumber(_argument_). - 1. If SameValue(! ToString(_n_), _argument_) is *false*, return *undefined*. + 1. If SameValue(! ToString(_n_), _argument_) is `false`, return `undefined`. 1. Return _n_. -

A canonical numeric string is any String value for which the CanonicalNumericIndexString abstract operation does not return *undefined*.

+

一个规范的数字字符串是指 CanonicalNumericIndexString 抽象操作返回值不为 *undefined* 的字符串。

ToIndex ( _value_ )

-

The abstract operation ToIndex returns _value_ argument converted to a numeric value if it is a valid integer index value. This abstract operation functions as follows:

+

抽象操作 ToIndex 负责将 _value_ 参数转换为一个有效的整数索引值。这个抽象操作算法如下:

- 1. If _value_ is *undefined*, then + 1. If _value_ is `undefined`, then 1. Let _index_ be 0. 1. Else, 1. Let _integerIndex_ be ? ToInteger(_value_).
- Argument Type + 参数类型 - Result + 结果
- Throw a *TypeError* exception. + 抛出一个 *TypeError* 异常。
- Throw a *TypeError* exception. + 抛出一个 *TypeError* 异常。
- Return a new Boolean object whose [[BooleanData]] internal slot is set to _argument_. See for a description of Boolean objects. + 返回一个内部槽 [[BooleanData]] 为 _argument_ 的新 Boolean 对象。见 关于 Boolean 对象的描述。
- Return a new Number object whose [[NumberData]] internal slot is set to _argument_. See for a description of Number objects. + 返回一个内部槽 [[NumberData]] 为 _argument_ 的新 Number 对象。见 关于 Number 对象的描述。
- Return a new String object whose [[StringData]] internal slot is set to _argument_. See for a description of String objects. + 返回一个内部槽 [[StringData]] 为 _argument_ 的新 String 对象。见 关于 String 对象的描述。
- Return a new Symbol object whose [[SymbolData]] internal slot is set to _argument_. See for a description of Symbol objects. + 返回一个内部槽 [[SymbolData]] 为 _argument_ 的新 Symbol 对象。见 关于 Symbol 对象的描述。
- Return _argument_. + 返回 _argument_。