Skip to content

Commit

Permalink
Merge pull request #52 from realywithoutname/translate/issue-14
Browse files Browse the repository at this point in the history
translated: issue #14
  • Loading branch information
realywithoutname authored Mar 9, 2018
2 parents 31278e1 + 04c0c69 commit 3eaad8a
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions translated/issues-14.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<emu-clause id="sec-isinteger" aoid="IsInteger">
<h1>IsInteger ( _argument_ )</h1>
<p>The abstract operation IsInteger determines if _argument_ is a finite integer numeric value.</p>
<p>抽象操作 IsInteger 用于判断 _argument_ 是否为一个有限整数数值。</p>
<emu-alg>
1. If Type(_argument_) is not Number, return *false*.
1. If _argument_ is *NaN*, *+&infin;*, or *-&infin;*, return *false*.
Expand All @@ -12,7 +12,7 @@ <h1>IsInteger ( _argument_ )</h1>
<!-- es6num="7.2.7" -->
<emu-clause id="sec-ispropertykey" aoid="IsPropertyKey">
<h1>IsPropertyKey ( _argument_ )</h1>
<p>The abstract operation IsPropertyKey determines if _argument_, which must be an ECMAScript language value, is a value that may be used as a property key.</p>
<p>抽象操作 IsPropertyKey 用于判断 _argument_ 是否可用作为对象的属性的 key,_argument_ 必须是一个 ECMAScript 语言值。</p>
<emu-alg>
1. If Type(_argument_) is String, return *true*.
1. If Type(_argument_) is Symbol, return *true*.
Expand All @@ -23,7 +23,7 @@ <h1>IsPropertyKey ( _argument_ )</h1>
<!-- es6num="7.2.8" -->
<emu-clause id="sec-isregexp" aoid="IsRegExp">
<h1>IsRegExp ( _argument_ )</h1>
<p>The abstract operation IsRegExp with argument _argument_ performs the following steps:</p>
<p>参数为 _argument_ 的抽象操作 IsRegExp 执行步骤如下:</p>
<emu-alg>
1. If Type(_argument_) is not Object, return *false*.
1. Let _matcher_ be ? Get(_argument_, @@match).
Expand All @@ -35,7 +35,7 @@ <h1>IsRegExp ( _argument_ )</h1>

<emu-clause id="sec-isstringprefix" aoid="IsStringPrefix">
<h1>IsStringPrefix ( _p_, _q_ )</h1>
<p>The abstract operation IsStringPrefix determines if String _p_ is a prefix of String _q_.</p>
<p>抽象操作 IsStringPrefix 确定字符串 _p_ 是不是字符串 _q_ 的前缀。</p>
<emu-alg>
1. Assert: Type(_p_) is String.
1. Assert: Type(_q_) is String.
Expand All @@ -47,7 +47,7 @@ <h1>IsStringPrefix ( _p_, _q_ )</h1>
<!-- es6num="7.2.9" -->
<emu-clause id="sec-samevalue" aoid="SameValue">
<h1>SameValue ( _x_, _y_ )</h1>
<p>The internal comparison abstract operation SameValue(_x_, _y_), where _x_ and _y_ are ECMAScript language values, produces *true* or *false*. Such a comparison is performed as follows:</p>
<p>内部比较抽象操作 SameValue(_x_, _y_) 返回 *true* *false*,其中 _x__y_ 都是 ECMAScript 语言值。它将执行比较如下:</p>
<emu-alg>
1. If Type(_x_) is different from Type(_y_), return *false*.
1. If Type(_x_) is Number, then
Expand All @@ -59,32 +59,32 @@ <h1>SameValue ( _x_, _y_ )</h1>
1. Return SameValueNonNumber(_x_, _y_).
</emu-alg>
<emu-note>
<p>This algorithm differs from the Strict Equality Comparison Algorithm in its treatment of signed zeroes and NaNs.</p>
<p>这个算法在比较有符号的 0 以及比较 NaN 时和严格相等比较算法不同。</p>
</emu-note>
</emu-clause>

<!-- es6num="7.2.10" -->
<emu-clause id="sec-samevaluezero" aoid="SameValueZero">
<h1>SameValueZero ( _x_, _y_ )</h1>
<p>The internal comparison abstract operation SameValueZero(_x_, _y_), where _x_ and _y_ are ECMAScript language values, produces *true* or *false*. Such a comparison is performed as follows:</p>
<p>内部比较抽象操作 SameValueZero(_x_, _y_) 返回 *true* *false*,其中 _x__y_ 都是ECMAScript语言值。 它将执行比较如下:</p>
<emu-alg>
1. If Type(_x_) is different from Type(_y_), return *false*.
1. If Type(_x_) is Number, then
1. If _x_ is *NaN* and _y_ is *NaN*, return *true*.
1. If _x_ is *+0* and _y_ is *-0*, return *true*.
1. If _x_ is *-0* and _y_ is *+0*, return *true*.
1. If _x_ is the same Number value as _y_, return *true*.
1. Return *false*.
1. Return `false`.
1. Return SameValueNonNumber(_x_, _y_).
</emu-alg>
<emu-note>
<p>SameValueZero differs from SameValue only in its treatment of *+0* and *-0*.</p>
<p>SameValueZero SameValue 仅在处理 `+0``-0` 时不同</p>
</emu-note>
</emu-clause>

<emu-clause id="sec-samevaluenonnumber" aoid="SameValueNonNumber">
<h1>SameValueNonNumber ( _x_, _y_ )</h1>
<p>The internal comparison abstract operation SameValueNonNumber(_x_, _y_), where neither _x_ nor _y_ are Number values, produces *true* or *false*. Such a comparison is performed as follows:</p>
<p>内部比较抽象操作 SameValueNonNumber(_x_, _y_) 返回 *true* *false*,其中 _x__y_ 都是 Number 值。它将执行比较如下:</p>
<emu-alg>
1. Assert: Type(_x_) is not Number.
1. Assert: Type(_x_) is the same as Type(_y_).
Expand All @@ -102,10 +102,10 @@ <h1>SameValueNonNumber ( _x_, _y_ )</h1>

<!-- es6num="7.2.11" -->
<emu-clause id="sec-abstract-relational-comparison" aoid="Abstract Relational Comparison">
<h1>Abstract Relational Comparison</h1>
<p>The comparison _x_ &lt; _y_, where _x_ and _y_ are values, produces *true*, *false*, or *undefined* (which indicates that at least one operand is *NaN*). In addition to _x_ and _y_ the algorithm takes a Boolean flag named _LeftFirst_ as a parameter. The flag is used to control the order in which operations with potentially visible side-effects are performed upon _x_ and _y_. It is necessary because ECMAScript specifies left to right evaluation of expressions. The default value of _LeftFirst_ is *true* and indicates that the _x_ parameter corresponds to an expression that occurs to the left of the _y_ parameter's corresponding expression. If _LeftFirst_ is *false*, the reverse is the case and operations must be performed upon _y_ before _x_. Such a comparison is performed as follows:</p>
<h1>抽象关系比较</h1>
<p>比较_x_ &lt; _y__x_ _y_ 都是 ECMAScript 语言值,将可能产生*true*, *false*, *undefined*(表示其中至少有一个操作数为 *NaN*)。除了 _x_ _y_ 之外,算法会使用一个名为 _LeftFirst_Boolean 类型标志,作为一个参数。这个标志用于控制对 _x_ _y_ 执行潜在可见副作用操作的顺序。这是有必要的,因为 ECMAScript 规定计算是从左向右的。_LeftFirst_ 的默认值为 *true*,表示 _x_ 参数相应表达式在 _y_ 参数相应的表达式的左测。如果 _LeftFirst_ *false*,则必须在 _x_ 之前执行 _y_。具体比较执行如下:</p>
<emu-alg>
1. If the _LeftFirst_ flag is *true*, then
1. If the _LeftFirst_ flag is `true`, then
1. Let _px_ be ? ToPrimitive(_x_, hint Number).
1. Let _py_ be ? ToPrimitive(_y_, hint Number).
1. Else the order of evaluation needs to be reversed to preserve left to right evaluation,
Expand All @@ -132,19 +132,19 @@ <h1>Abstract Relational Comparison</h1>
1. If _ny_ is *-&infin;*, return *false*.
1. If _nx_ is *-&infin;*, return *true*.
1. If the mathematical value of _nx_ is less than the mathematical value of _ny_&mdash;note that these mathematical values are both finite and not both zero&mdash;return *true*. Otherwise, return *false*.
</emu-alg>
</emu-alg>
<emu-note>
<p>Step 3 differs from step 7 in the algorithm for the addition operator `+` (<emu-xref href="#sec-addition-operator-plus"></emu-xref>) by using the logical-and operation instead of the logical-or operation.</p>
<p>算法中的第三步和第七步不同是加法运算 `+` (<emu-xref href="#sec-addition-operator-plus"></emu-xref>)使用逻辑与操作而不是使用逻辑或操作。</p>
</emu-note>
<emu-note>
<p>The comparison of Strings uses a simple lexicographic ordering on sequences of code unit values. There is no attempt to use the more complex, semantically oriented definitions of character or string equality and collating order defined in the Unicode specification. Therefore String values that are canonically equal according to the Unicode standard could test as unequal. In effect this algorithm assumes that both Strings are already in normalized form. Also, note that for strings containing supplementary characters, lexicographic ordering on sequences of UTF-16 code unit values differs from that on sequences of code point values.</p>
<p>字符串类型的比较使用码元值序列的简单词典排序。这里没有尝试使用 Unicode 规范定义的更复杂的,基于语义的字符或字符串相等,以及排序顺序进行比较。因此,根据 Unicode 标准在规范上相等的字符串值可能测试为不相等。实际上,该算法假设了两个值是已经标准化的值。另外还需注意,对于包含补充字符的字符串,UTF-16 码元值序列与普通码元值序列的词典排序是不同的。</p>
</emu-note>
</emu-clause>

<!-- es6num="7.2.12" -->
<emu-clause id="sec-abstract-equality-comparison" aoid="Abstract Equality Comparison">
<h1>Abstract Equality Comparison</h1>
<p>The comparison _x_ == _y_, where _x_ and _y_ are values, produces *true* or *false*. Such a comparison is performed as follows:</p>
<h1>抽象相等比较</h1>
<p>比较 _x_ == _y_,产生 *true**false*,其中 _x__y_ 都是 ECMAScript 语言值。具体比较算法如下:</p>
<emu-alg>
1. If Type(_x_) is the same as Type(_y_), then
1. Return the result of performing Strict Equality Comparison _x_ === _y_.
Expand All @@ -162,8 +162,8 @@ <h1>Abstract Equality Comparison</h1>

<!-- es6num="7.2.13" -->
<emu-clause id="sec-strict-equality-comparison" aoid="Strict Equality Comparison">
<h1>Strict Equality Comparison</h1>
<p>The comparison _x_ === _y_, where _x_ and _y_ are values, produces *true* or *false*. Such a comparison is performed as follows:</p>
<h1>严格相等比较</h1>
<p>比较 _x_ === _y_,产生 *true**false*,其中 _x__y_ 都是ECMAScript语言值。具体比较算法如下:</p>
<emu-alg>
1. If Type(_x_) is different from Type(_y_), return *false*.
1. If Type(_x_) is Number, then
Expand All @@ -176,7 +176,7 @@ <h1>Strict Equality Comparison</h1>
1. Return SameValueNonNumber(_x_, _y_).
</emu-alg>
<emu-note>
<p>This algorithm differs from the SameValue Algorithm in its treatment of signed zeroes and NaNs.</p>
<p>该算法与SameValue算法不同之处在于对有符号的 0 和 NaN 的处理。</p>
</emu-note>
</emu-clause>
</emu-clause>

0 comments on commit 3eaad8a

Please sign in to comment.