From 4fe65d1529acc3675c9f5b5a5b979508309a26ca Mon Sep 17 00:00:00 2001 From: JD Liu Date: Fri, 15 Dec 2017 13:24:34 +0800 Subject: [PATCH] split: LN 3336 - 4900 created issues #11,#12,#13,#14,#15,#16 --- translated/issues-11.html | 380 +++++++++++++++++++++++++++++++++++++ translated/issues-12.html | 385 ++++++++++++++++++++++++++++++++++++++ translated/issues-13.html | 125 +++++++++++++ translated/issues-14.html | 182 ++++++++++++++++++ translated/issues-15.html | 352 ++++++++++++++++++++++++++++++++++ translated/isuues-16.html | 131 +++++++++++++ 6 files changed, 1555 insertions(+) create mode 100644 translated/issues-11.html create mode 100644 translated/issues-12.html create mode 100644 translated/issues-13.html create mode 100644 translated/issues-14.html create mode 100644 translated/issues-15.html create mode 100644 translated/isuues-16.html diff --git a/translated/issues-11.html b/translated/issues-11.html new file mode 100644 index 00000000000..8e09048f4fc --- /dev/null +++ b/translated/issues-11.html @@ -0,0 +1,380 @@ + +

Abstract Operations

+

These operations are not a part of the ECMAScript language; they are defined here to solely to aid the specification of the semantics of the ECMAScript language. Other, more specialized abstract operations are defined throughout this specification.

+ + + +

Type Conversion

+

The ECMAScript language implicitly performs automatic type conversion as needed. To clarify the semantics of certain constructs it is useful to define a set of conversion abstract operations. The conversion abstract operations are polymorphic; they can accept a value of any ECMAScript language type. But no other specification types are used with these operations.

+ + + +

ToPrimitive ( _input_ [ , _PreferredType_ ] )

+

The abstract operation ToPrimitive takes an _input_ argument and an optional argument _PreferredType_. The abstract operation ToPrimitive converts its _input_ argument to a non-Object type. If an object is capable of converting to more than one primitive type, it may use the optional hint _PreferredType_ to favour that type. Conversion occurs according to the following algorithm:

+ + 1. Assert: _input_ is an ECMAScript language value. + 1. If Type(_input_) is Object, then + 1. If _PreferredType_ is not present, let _hint_ be `"default"`. + 1. Else if _PreferredType_ is hint String, let _hint_ be `"string"`. + 1. Else _PreferredType_ is hint Number, let _hint_ be `"number"`. + 1. Let _exoticToPrim_ be ? GetMethod(_input_, @@toPrimitive). + 1. If _exoticToPrim_ is not *undefined*, then + 1. Let _result_ be ? Call(_exoticToPrim_, _input_, « _hint_ »). + 1. If Type(_result_) is not Object, return _result_. + 1. Throw a *TypeError* exception. + 1. If _hint_ is `"default"`, set _hint_ to `"number"`. + 1. Return ? OrdinaryToPrimitive(_input_, _hint_). + 1. Return _input_. + + +

When ToPrimitive is called with no hint, then it generally behaves as if the hint were Number. However, objects may over-ride this behaviour by defining a @@toPrimitive method. Of the objects defined in this specification only Date objects (see ) and Symbol objects (see ) over-ride the default ToPrimitive behaviour. Date objects treat no hint as if the hint were String.

+
+ + +

OrdinaryToPrimitive ( _O_, _hint_ )

+

When the abstract operation OrdinaryToPrimitive is called with arguments _O_ and _hint_, the following steps are taken:

+ + 1. Assert: Type(_O_) is Object. + 1. Assert: Type(_hint_) is String and its value is either `"string"` or `"number"`. + 1. If _hint_ is `"string"`, then + 1. Let _methodNames_ be « `"toString"`, `"valueOf"` ». + 1. Else, + 1. Let _methodNames_ be « `"valueOf"`, `"toString"` ». + 1. For each _name_ in _methodNames_ in List order, do + 1. Let _method_ be ? Get(_O_, _name_). + 1. If IsCallable(_method_) is *true*, then + 1. Let _result_ be ? Call(_method_, _O_). + 1. If Type(_result_) is not Object, return _result_. + 1. Throw a *TypeError* exception. + +
+
+ + + +

ToBoolean ( _argument_ )

+

The abstract operation ToBoolean converts _argument_ to a value of type Boolean according to :

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Argument Type + + Result +
+ Undefined + + Return *false*. +
+ Null + + Return *false*. +
+ Boolean + + Return _argument_. +
+ Number + + If _argument_ is *+0*, *-0*, or *NaN*, return *false*; otherwise return *true*. +
+ String + + If _argument_ is the empty String (its length is zero), return *false*; otherwise return *true*. +
+ Symbol + + Return *true*. +
+ Object + + Return *true*. +
+
+
+ + + +

ToNumber ( _argument_ )

+

The abstract operation ToNumber converts _argument_ to a value of type Number according to :

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Argument Type + + Result +
+ Undefined + + Return *NaN*. +
+ Null + + Return *+0*. +
+ Boolean + + If _argument_ is *true*, return 1. If _argument_ is *false*, return *+0*. +
+ Number + + Return _argument_ (no conversion). +
+ String + + See grammar and conversion algorithm below. +
+ Symbol + + Throw a *TypeError* exception. +
+ Object + +

Apply the following steps:

+ + 1. Let _primValue_ be ? ToPrimitive(_argument_, hint Number). + 1. Return ? ToNumber(_primValue_). + +
+
+ + + +

ToNumber Applied to the String Type

+

ToNumber applied to Strings applies the following grammar to the input String interpreted as a sequence of UTF-16 encoded code points (). If the grammar cannot interpret the String as an expansion of |StringNumericLiteral|, then the result of ToNumber is *NaN*.

+ +

The terminal symbols of this grammar are all composed of Unicode BMP code points so the result will be *NaN* if the string contains the UTF-16 encoding of any supplementary code points or any unpaired surrogate code points.

+
+

Syntax

+ + StringNumericLiteral ::: + StrWhiteSpace? + StrWhiteSpace? StrNumericLiteral StrWhiteSpace? + + StrWhiteSpace ::: + StrWhiteSpaceChar StrWhiteSpace? + + StrWhiteSpaceChar ::: + WhiteSpace + LineTerminator + + StrNumericLiteral ::: + StrDecimalLiteral + BinaryIntegerLiteral + OctalIntegerLiteral + HexIntegerLiteral + + StrDecimalLiteral ::: + StrUnsignedDecimalLiteral + `+` StrUnsignedDecimalLiteral + `-` StrUnsignedDecimalLiteral + + StrUnsignedDecimalLiteral ::: + `Infinity` + DecimalDigits `.` DecimalDigits? ExponentPart? + `.` DecimalDigits ExponentPart? + DecimalDigits ExponentPart? + +

All grammar symbols not explicitly defined above have the definitions used in the Lexical Grammar for numeric literals ()

+ +

Some differences should be noted between the syntax of a |StringNumericLiteral| and a |NumericLiteral|:

+
    +
  • + A |StringNumericLiteral| may include leading and/or trailing white space and/or line terminators. +
  • +
  • + A |StringNumericLiteral| that is decimal may have any number of leading `0` digits. +
  • +
  • + A |StringNumericLiteral| that is decimal may include a `+` or `-` to indicate its sign. +
  • +
  • + A |StringNumericLiteral| that is empty or contains only white space is converted to *+0*. +
  • +
  • + `Infinity` and `-Infinity` are recognized as a |StringNumericLiteral| but not as a |NumericLiteral|. +
  • +
+
+ + + +

Runtime Semantics: MV

+

The conversion of a String to a Number value is similar overall to the determination of the Number value for a numeric literal (see ), but some of the details are different, so the process for converting a String numeric literal to a value of Number type is given here. This value is determined in two steps: first, a mathematical value (MV) is derived from the String numeric literal; second, this mathematical value is rounded as described below. The MV on any grammar symbol, not provided below, is the MV for that symbol defined in .

+
    +
  • + The MV of StringNumericLiteral ::: [empty] is 0. +
  • +
  • + The MV of StringNumericLiteral ::: StrWhiteSpace is 0. +
  • +
  • + The MV of StringNumericLiteral ::: StrWhiteSpace? StrNumericLiteral StrWhiteSpace? is the MV of |StrNumericLiteral|, no matter whether white space is present or not. +
  • +
  • + The MV of StrNumericLiteral ::: StrDecimalLiteral is the MV of |StrDecimalLiteral|. +
  • +
  • + The MV of StrNumericLiteral ::: BinaryIntegerLiteral is the MV of |BinaryIntegerLiteral|. +
  • +
  • + The MV of StrNumericLiteral ::: OctalIntegerLiteral is the MV of |OctalIntegerLiteral|. +
  • +
  • + The MV of StrNumericLiteral ::: HexIntegerLiteral is the MV of |HexIntegerLiteral|. +
  • +
  • + The MV of StrDecimalLiteral ::: StrUnsignedDecimalLiteral is the MV of |StrUnsignedDecimalLiteral|. +
  • +
  • + The MV of StrDecimalLiteral ::: `+` StrUnsignedDecimalLiteral is the MV of |StrUnsignedDecimalLiteral|. +
  • +
  • + The MV of StrDecimalLiteral ::: `-` StrUnsignedDecimalLiteral is the negative of the MV of |StrUnsignedDecimalLiteral|. (Note that if the MV of |StrUnsignedDecimalLiteral| is 0, the negative of this MV is also 0. The rounding rule described below handles the conversion of this signless mathematical zero to a floating-point *+0* or *-0* as appropriate.) +
  • +
  • + The MV of StrUnsignedDecimalLiteral ::: `Infinity` is 1010000 (a value so large that it will round to *+∞*). +
  • +
  • + The MV of StrUnsignedDecimalLiteral ::: DecimalDigits `.` is the MV of |DecimalDigits|. +
  • +
  • + The MV of StrUnsignedDecimalLiteral ::: DecimalDigits `.` DecimalDigits is the MV of the first |DecimalDigits| plus (the MV of the second |DecimalDigits| times 10-_n_), where _n_ is the number of code points in the second |DecimalDigits|. +
  • +
  • + The MV of StrUnsignedDecimalLiteral ::: DecimalDigits `.` ExponentPart is the MV of |DecimalDigits| times 10_e_, where _e_ is the MV of |ExponentPart|. +
  • +
  • + The MV of StrUnsignedDecimalLiteral ::: DecimalDigits `.` DecimalDigits ExponentPart is (the MV of the first |DecimalDigits| plus (the MV of the second |DecimalDigits| times 10-_n_)) times 10_e_, where _n_ is the number of code points in the second |DecimalDigits| and _e_ is the MV of |ExponentPart|. +
  • +
  • + The MV of StrUnsignedDecimalLiteral ::: `.` DecimalDigits is the MV of |DecimalDigits| times 10-_n_, where _n_ is the number of code points in |DecimalDigits|. +
  • +
  • + The MV of StrUnsignedDecimalLiteral ::: `.` DecimalDigits ExponentPart is the MV of |DecimalDigits| times 10_e_-_n_, where _n_ is the number of code points in |DecimalDigits| and _e_ is the MV of |ExponentPart|. +
  • +
  • + The MV of StrUnsignedDecimalLiteral ::: DecimalDigits is the MV of |DecimalDigits|. +
  • +
  • + The MV of StrUnsignedDecimalLiteral ::: DecimalDigits ExponentPart is the MV of |DecimalDigits| times 10_e_, where _e_ is the MV of |ExponentPart|. +
  • +
+

Once the exact MV for a String numeric literal has been determined, it is then rounded to a value of the Number type. If the MV is 0, then the rounded value is *+0* unless the first non white space code point in the String numeric literal is `"-"`, in which case the rounded value is *-0*. Otherwise, the rounded value must be the Number value for the MV (in the sense defined in ), unless the literal includes a |StrUnsignedDecimalLiteral| and the literal has more than 20 significant digits, in which case the Number value may be either the Number value for the MV of a literal produced by replacing each significant digit after the 20th with a 0 digit or the Number value for the MV of a literal produced by replacing each significant digit after the 20th with a 0 digit and then incrementing the literal at the 20th digit position. A digit is significant if it is not part of an |ExponentPart| and

+
    +
  • + it is not `0`; or +
  • +
  • + there is a nonzero digit to its left and there is a nonzero digit, not in the |ExponentPart|, to its right. +
  • +
+
+
+
+ + + +

ToInteger ( _argument_ )

+

The abstract operation ToInteger converts _argument_ to an integral numeric value. This abstract operation functions as follows:

+ + 1. Let _number_ be ? ToNumber(_argument_). + 1. If _number_ is *NaN*, return *+0*. + 1. If _number_ is *+0*, *-0*, *+∞*, or *-∞*, return _number_. + 1. Return the number value that is the same sign as _number_ and whose magnitude is floor(abs(_number_)). + +
+ + + +

ToInt32 ( _argument_ )

+

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

+ + 1. Let _number_ be ? ToNumber(_argument_). + 1. If _number_ is *NaN*, *+0*, *-0*, *+∞*, or *-∞*, return *+0*. + 1. Let _int_ be the mathematical value that is the same sign as _number_ and whose magnitude is floor(abs(_number_)). + 1. Let _int32bit_ be _int_ modulo 232. + 1. If _int32bit_ ≥ 231, return _int32bit_ - 232; otherwise return _int32bit_. + + +

Given the above definition of ToInt32:

+
    +
  • + The ToInt32 abstract operation is idempotent: if applied to a result that it produced, the second application leaves that value unchanged. +
  • +
  • + ToInt32(ToUint32(_x_)) is equal to ToInt32(_x_) for all values of _x_. (It is to preserve this latter property that *+∞* and *-∞* are mapped to *+0*.) +
  • +
  • + ToInt32 maps *-0* to *+0*. +
  • +
+
+
\ No newline at end of file diff --git a/translated/issues-12.html b/translated/issues-12.html new file mode 100644 index 00000000000..087a646decf --- /dev/null +++ b/translated/issues-12.html @@ -0,0 +1,385 @@ + +

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:

+ + 1. Let _number_ be ? ToNumber(_argument_). + 1. If _number_ is *NaN*, *+0*, *-0*, *+∞*, or *-∞*, return *+0*. + 1. Let _int_ be the mathematical value that is the same sign as _number_ and whose magnitude is floor(abs(_number_)). + 1. Let _int32bit_ be _int_ modulo 232. + 1. Return _int32bit_. + + +

Given the above definition of ToUint32:

+
    +
  • + Step 5 is the only difference between ToUint32 and ToInt32. +
  • +
  • + The ToUint32 abstract operation is idempotent: if applied to a result that it produced, the second application leaves that value unchanged. +
  • +
  • + 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*.) +
  • +
  • + ToUint32 maps *-0* to *+0*. +
  • +
+
+
+ + + +

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:

+ + 1. Let _number_ be ? ToNumber(_argument_). + 1. If _number_ is *NaN*, *+0*, *-0*, *+∞*, or *-∞*, return *+0*. + 1. Let _int_ be the mathematical value that is the same sign as _number_ and whose magnitude is floor(abs(_number_)). + 1. Let _int16bit_ be _int_ modulo 216. + 1. If _int16bit_ ≥ 215, return _int16bit_ - 216; otherwise return _int16bit_. + +
+ + + +

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:

+ + 1. Let _number_ be ? ToNumber(_argument_). + 1. If _number_ is *NaN*, *+0*, *-0*, *+∞*, or *-∞*, return *+0*. + 1. Let _int_ be the mathematical value that is the same sign as _number_ and whose magnitude is floor(abs(_number_)). + 1. Let _int16bit_ be _int_ modulo 216. + 1. Return _int16bit_. + + +

Given the above definition of ToUint16:

+
    +
  • + The substitution of 216 for 232 in step 4 is the only difference between ToUint32 and ToUint16. +
  • +
  • + ToUint16 maps *-0* to *+0*. +
  • +
+
+
+ + + +

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:

+ + 1. Let _number_ be ? ToNumber(_argument_). + 1. If _number_ is *NaN*, *+0*, *-0*, *+∞*, or *-∞*, return *+0*. + 1. Let _int_ be the mathematical value that is the same sign as _number_ and whose magnitude is floor(abs(_number_)). + 1. Let _int8bit_ be _int_ modulo 28. + 1. If _int8bit_ ≥ 27, return _int8bit_ - 28; otherwise return _int8bit_. + +
+ + + +

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:

+ + 1. Let _number_ be ? ToNumber(_argument_). + 1. If _number_ is *NaN*, *+0*, *-0*, *+∞*, or *-∞*, return *+0*. + 1. Let _int_ be the mathematical value that is the same sign as _number_ and whose magnitude is floor(abs(_number_)). + 1. Let _int8bit_ be _int_ modulo 28. + 1. Return _int8bit_. + +
+ + + +

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:

+ + 1. Let _number_ be ? ToNumber(_argument_). + 1. If _number_ is *NaN*, return *+0*. + 1. If _number_ ≤ 0, return *+0*. + 1. If _number_ ≥ 255, return 255. + 1. Let _f_ be floor(_number_). + 1. If _f_ + 0.5 < _number_, return _f_ + 1. + 1. If _number_ < _f_ + 0.5, return _f_. + 1. If _f_ is odd, return _f_ + 1. + 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.

+
+
+ + + +

ToString ( _argument_ )

+

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

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Argument Type + + Result +
+ Undefined + + Return `"undefined"`. +
+ Null + + Return `"null"`. +
+ Boolean + +

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

+

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

+
+ Number + + Return NumberToString(_argument_). +
+ String + + Return _argument_. +
+ Symbol + + Throw a *TypeError* exception. +
+ Object + +

Apply the following steps:

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

NumberToString ( _m_ )

+

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

+ + 1. If _m_ is *NaN*, return the String `"NaN"`. + 1. If _m_ is *+0* or *-0*, return the String `"0"`. + 1. If _m_ is less than zero, return the string-concatenation of `"-"` and ! ToString(-_m_). + 1. If _m_ is *+∞*, return the String `"Infinity"`. + 1. 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. Note that _k_ is the number of digits in the decimal representation of _s_, that _s_ is not divisible by 10, and that the least significant digit of _s_ is not necessarily uniquely determined by these criteria. + 1. If _k_ ≤ _n_ ≤ 21, return the string-concatenation of: + * the code units of the _k_ digits of the decimal representation of _s_ (in order, with no leading zeroes) + * _n_-_k_ occurrences of the code unit 0x0030 (DIGIT ZERO) + 1. If 0 < _n_ ≤ 21, return the string-concatenation of: + * the code units of the most significant _n_ digits of the decimal representation of _s_ + * the code unit 0x002E (FULL STOP) + * the code units of the remaining _k_-_n_ digits of the decimal representation of _s_ + 1. If -6 < _n_ ≤ 0, return the string-concatenation of: + * the code unit 0x0030 (DIGIT ZERO) + * the code unit 0x002E (FULL STOP) + * -_n_ occurrences of the code unit 0x0030 (DIGIT ZERO) + * the code units of the _k_ digits of the decimal representation of _s_ + 1. Otherwise, if _k_ = 1, return the string-concatenation of: + * the code unit of the single digit of _s_ + * the code unit 0x0065 (LATIN SMALL LETTER E) + * the code unit 0x002B (PLUS SIGN) or the code unit 0x002D (HYPHEN-MINUS) according to whether _n_-1 is positive or negative + * the code units of the decimal representation of the integer abs(_n_-1) (with no leading zeroes) + 1. Return the string-concatenation of: + * the code units of the most significant digit of the decimal representation of _s_ + * the code unit 0x002E (FULL STOP) + * the code units of the remaining _k_-1 digits of the decimal representation of _s_ + * the code unit 0x0065 (LATIN SMALL LETTER E) + * the code unit 0x002B (PLUS SIGN) or the code unit 0x002D (HYPHEN-MINUS) according to whether _n_-1 is positive or negative + * 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. +
  • +
  • + The least significant digit of s is not always uniquely determined by the requirements listed in step 5. +
  • +
+
+ +

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 +
+ http://ampl.com/REFS/abstracts.html#rounding. Associated code available as +
+ http://netlib.sandia.gov/fp/dtoa.c and as +
+ http://netlib.sandia.gov/fp/g_fmt.c and may also be found at the various `netlib` mirror sites.

+
+
+
+ + + +

ToObject ( _argument_ )

+

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

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Argument Type + + Result +
+ Undefined + + Throw a *TypeError* exception. +
+ Null + + Throw a *TypeError* exception. +
+ Boolean + + Return a new Boolean object whose [[BooleanData]] internal slot is set to _argument_. See for a description of Boolean objects. +
+ Number + + Return a new Number object whose [[NumberData]] internal slot is set to _argument_. See for a description of Number objects. +
+ String + + Return a new String object whose [[StringData]] internal slot is set to _argument_. See for a description of String objects. +
+ Symbol + + Return a new Symbol object whose [[SymbolData]] internal slot is set to _argument_. See for a description of Symbol objects. +
+ Object + + Return _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:

+ + 1. Let _key_ be ? ToPrimitive(_argument_, hint String). + 1. If Type(_key_) is Symbol, then + 1. Return _key_. + 1. Return ! ToString(_key_). + +
+ + + +

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:

+ + 1. Let _len_ be ? ToInteger(_argument_). + 1. If _len_ ≤ *+0*, return *+0*. + 1. Return min(_len_, 253-1). + +
+ + + +

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:

+ + 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. Return _n_. + +

A canonical numeric string is any String value for which the CanonicalNumericIndexString abstract operation does not return *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:

+ + 1. If _value_ is *undefined*, then + 1. Let _index_ be 0. + 1. Else, + 1. Let _integerIndex_ be ? ToInteger(_value_). + 1. If _integerIndex_ < 0, throw a *RangeError* exception. + 1. Let _index_ be ! ToLength(_integerIndex_). + 1. If SameValueZero(_integerIndex_, _index_) is *false*, throw a *RangeError* exception. + 1. Return _index_. + +
+
\ No newline at end of file diff --git a/translated/issues-13.html b/translated/issues-13.html new file mode 100644 index 00000000000..a320dcd6a6a --- /dev/null +++ b/translated/issues-13.html @@ -0,0 +1,125 @@ + +

Testing and Comparison Operations

+ + + +

RequireObjectCoercible ( _argument_ )

+

The abstract operation RequireObjectCoercible throws an error if _argument_ is a value that cannot be converted to an Object using ToObject. It is defined by :

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Argument Type + + Result +
+ Undefined + + Throw a *TypeError* exception. +
+ Null + + Throw a *TypeError* exception. +
+ Boolean + + Return _argument_. +
+ Number + + Return _argument_. +
+ String + + Return _argument_. +
+ Symbol + + Return _argument_. +
+ Object + + Return _argument_. +
+
+
+ + + +

IsArray ( _argument_ )

+

The abstract operation IsArray takes one argument _argument_, and performs the following steps:

+ + 1. If Type(_argument_) is not Object, return *false*. + 1. If _argument_ is an Array exotic object, return *true*. + 1. If _argument_ is a Proxy exotic object, then + 1. If _argument_.[[ProxyHandler]] is *null*, throw a *TypeError* exception. + 1. Let _target_ be _argument_.[[ProxyTarget]]. + 1. Return ? IsArray(_target_). + 1. Return *false*. + +
+ + + +

IsCallable ( _argument_ )

+

The abstract operation IsCallable determines if _argument_, which must be an ECMAScript language value, is a callable function with a [[Call]] internal method.

+ + 1. If Type(_argument_) is not Object, return *false*. + 1. If _argument_ has a [[Call]] internal method, return *true*. + 1. Return *false*. + +
+ + + +

IsConstructor ( _argument_ )

+

The abstract operation IsConstructor determines if _argument_, which must be an ECMAScript language value, is a function object with a [[Construct]] internal method.

+ + 1. If Type(_argument_) is not Object, return *false*. + 1. If _argument_ has a [[Construct]] internal method, return *true*. + 1. Return *false*. + +
+ + + +

IsExtensible ( _O_ )

+

The abstract operation IsExtensible is used to determine whether additional properties can be added to the object that is _O_. A Boolean value is returned. This abstract operation performs the following steps:

+ + 1. Assert: Type(_O_) is Object. + 1. Return ? _O_.[[IsExtensible]](). + +
\ No newline at end of file diff --git a/translated/issues-14.html b/translated/issues-14.html new file mode 100644 index 00000000000..0266f22c4b6 --- /dev/null +++ b/translated/issues-14.html @@ -0,0 +1,182 @@ + +

IsInteger ( _argument_ )

+

The abstract operation IsInteger determines if _argument_ is a finite integer numeric value.

+ + 1. If Type(_argument_) is not Number, return *false*. + 1. If _argument_ is *NaN*, *+∞*, or *-∞*, return *false*. + 1. If floor(abs(_argument_)) ≠ abs(_argument_), return *false*. + 1. Return *true*. + +
+ + + +

IsPropertyKey ( _argument_ )

+

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.

+ + 1. If Type(_argument_) is String, return *true*. + 1. If Type(_argument_) is Symbol, return *true*. + 1. Return *false*. + +
+ + + +

IsRegExp ( _argument_ )

+

The abstract operation IsRegExp with argument _argument_ performs the following steps:

+ + 1. If Type(_argument_) is not Object, return *false*. + 1. Let _matcher_ be ? Get(_argument_, @@match). + 1. If _matcher_ is not *undefined*, return ToBoolean(_matcher_). + 1. If _argument_ has a [[RegExpMatcher]] internal slot, return *true*. + 1. Return *false*. + +
+ + +

IsStringPrefix ( _p_, _q_ )

+

The abstract operation IsStringPrefix determines if String _p_ is a prefix of String _q_.

+ + 1. Assert: Type(_p_) is String. + 1. Assert: Type(_q_) is String. + 1. If _q_ can be the string-concatenation of _p_ and some other String _r_, return *true*. Otherwise, return *false*. + 1. NOTE: Any String is a prefix of itself, because _r_ may be the empty String. + +
+ + + +

SameValue ( _x_, _y_ )

+

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:

+ + 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 *false*. + 1. If _x_ is *-0* and _y_ is *+0*, return *false*. + 1. If _x_ is the same Number value as _y_, return *true*. + 1. Return *false*. + 1. Return SameValueNonNumber(_x_, _y_). + + +

This algorithm differs from the Strict Equality Comparison Algorithm in its treatment of signed zeroes and NaNs.

+
+
+ + + +

SameValueZero ( _x_, _y_ )

+

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:

+ + 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 SameValueNonNumber(_x_, _y_). + + +

SameValueZero differs from SameValue only in its treatment of *+0* and *-0*.

+
+
+ + +

SameValueNonNumber ( _x_, _y_ )

+

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:

+ + 1. Assert: Type(_x_) is not Number. + 1. Assert: Type(_x_) is the same as Type(_y_). + 1. If Type(_x_) is Undefined, return *true*. + 1. If Type(_x_) is Null, return *true*. + 1. If Type(_x_) is String, then + 1. If _x_ and _y_ are exactly the same sequence of code units (same length and same code units at corresponding indices), return *true*; otherwise, return *false*. + 1. If Type(_x_) is Boolean, then + 1. If _x_ and _y_ are both *true* or both *false*, return *true*; otherwise, return *false*. + 1. If Type(_x_) is Symbol, then + 1. If _x_ and _y_ are both the same Symbol value, return *true*; otherwise, return *false*. + 1. If _x_ and _y_ are the same Object value, return *true*. Otherwise, return *false*. + +
+ + + +

Abstract Relational Comparison

+

The comparison _x_ < _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:

+ + 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, + 1. Let _py_ be ? ToPrimitive(_y_, hint Number). + 1. Let _px_ be ? ToPrimitive(_x_, hint Number). + 1. If Type(_px_) is String and Type(_py_) is String, then + 1. If IsStringPrefix(_py_, _px_) is *true*, return *false*. + 1. If IsStringPrefix(_px_, _py_) is *true*, return *true*. + 1. Let _k_ be the smallest nonnegative integer such that the code unit at index _k_ within _px_ is different from the code unit at index _k_ within _py_. (There must be such a _k_, for neither String is a prefix of the other.) + 1. Let _m_ be the integer that is the numeric value of the code unit at index _k_ within _px_. + 1. Let _n_ be the integer that is the numeric value of the code unit at index _k_ within _py_. + 1. If _m_ < _n_, return *true*. Otherwise, return *false*. + 1. Else, + 1. NOTE: Because _px_ and _py_ are primitive values evaluation order is not important. + 1. Let _nx_ be ? ToNumber(_px_). + 1. Let _ny_ be ? ToNumber(_py_). + 1. If _nx_ is *NaN*, return *undefined*. + 1. If _ny_ is *NaN*, return *undefined*. + 1. If _nx_ and _ny_ are the same Number value, return *false*. + 1. If _nx_ is *+0* and _ny_ is *-0*, return *false*. + 1. If _nx_ is *-0* and _ny_ is *+0*, return *false*. + 1. If _nx_ is *+∞*, return *false*. + 1. If _ny_ is *+∞*, return *true*. + 1. If _ny_ is *-∞*, return *false*. + 1. If _nx_ is *-∞*, return *true*. + 1. If the mathematical value of _nx_ is less than the mathematical value of _ny_—note that these mathematical values are both finite and not both zero—return *true*. Otherwise, return *false*. + + +

Step 3 differs from step 7 in the algorithm for the addition operator `+` () by using the logical-and operation instead of the logical-or operation.

+
+ +

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.

+
+
+ + + +

Abstract Equality Comparison

+

The comparison _x_ == _y_, where _x_ and _y_ are values, produces *true* or *false*. Such a comparison is performed as follows:

+ + 1. If Type(_x_) is the same as Type(_y_), then + 1. Return the result of performing Strict Equality Comparison _x_ === _y_. + 1. If _x_ is *null* and _y_ is *undefined*, return *true*. + 1. If _x_ is *undefined* and _y_ is *null*, return *true*. + 1. If Type(_x_) is Number and Type(_y_) is String, return the result of the comparison _x_ == ! ToNumber(_y_). + 1. If Type(_x_) is String and Type(_y_) is Number, return the result of the comparison ! ToNumber(_x_) == _y_. + 1. If Type(_x_) is Boolean, return the result of the comparison ! ToNumber(_x_) == _y_. + 1. If Type(_y_) is Boolean, return the result of the comparison _x_ == ! ToNumber(_y_). + 1. If Type(_x_) is either String, Number, or Symbol and Type(_y_) is Object, return the result of the comparison _x_ == ToPrimitive(_y_). + 1. If Type(_x_) is Object and Type(_y_) is either String, Number, or Symbol, return the result of the comparison ToPrimitive(_x_) == _y_. + 1. Return *false*. + +
+ + + +

Strict Equality Comparison

+

The comparison _x_ === _y_, where _x_ and _y_ are values, produces *true* or *false*. Such a comparison is performed as follows:

+ + 1. If Type(_x_) is different from Type(_y_), return *false*. + 1. If Type(_x_) is Number, then + 1. If _x_ is *NaN*, return *false*. + 1. If _y_ is *NaN*, return *false*. + 1. If _x_ is the same Number value as _y_, 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. Return *false*. + 1. Return SameValueNonNumber(_x_, _y_). + + +

This algorithm differs from the SameValue Algorithm in its treatment of signed zeroes and NaNs.

+
+
+
\ No newline at end of file diff --git a/translated/issues-15.html b/translated/issues-15.html new file mode 100644 index 00000000000..2b9ad9d5570 --- /dev/null +++ b/translated/issues-15.html @@ -0,0 +1,352 @@ + +

Operations on Objects

+ + + +

Get ( _O_, _P_ )

+

The abstract operation Get is used to retrieve the value of a specific property of an object. The operation is called with arguments _O_ and _P_ where _O_ is the object and _P_ is the property key. This abstract operation performs the following steps:

+ + 1. Assert: Type(_O_) is Object. + 1. Assert: IsPropertyKey(_P_) is *true*. + 1. Return ? _O_.[[Get]](_P_, _O_). + +
+ + + +

GetV ( _V_, _P_ )

+

The abstract operation GetV is used to retrieve the value of a specific property of an ECMAScript language value. If the value is not an object, the property lookup is performed using a wrapper object appropriate for the type of the value. The operation is called with arguments _V_ and _P_ where _V_ is the value and _P_ is the property key. This abstract operation performs the following steps:

+ + 1. Assert: IsPropertyKey(_P_) is *true*. + 1. Let _O_ be ? ToObject(_V_). + 1. Return ? _O_.[[Get]](_P_, _V_). + +
+ + + +

Set ( _O_, _P_, _V_, _Throw_ )

+

The abstract operation Set is used to set the value of a specific property of an object. The operation is called with arguments _O_, _P_, _V_, and _Throw_ where _O_ is the object, _P_ is the property key, _V_ is the new value for the property and _Throw_ is a Boolean flag. This abstract operation performs the following steps:

+ + 1. Assert: Type(_O_) is Object. + 1. Assert: IsPropertyKey(_P_) is *true*. + 1. Assert: Type(_Throw_) is Boolean. + 1. Let _success_ be ? _O_.[[Set]](_P_, _V_, _O_). + 1. If _success_ is *false* and _Throw_ is *true*, throw a *TypeError* exception. + 1. Return _success_. + +
+ + + +

CreateDataProperty ( _O_, _P_, _V_ )

+

The abstract operation CreateDataProperty is used to create a new own property of an object. The operation is called with arguments _O_, _P_, and _V_ where _O_ is the object, _P_ is the property key, and _V_ is the value for the property. This abstract operation performs the following steps:

+ + 1. Assert: Type(_O_) is Object. + 1. Assert: IsPropertyKey(_P_) is *true*. + 1. Let _newDesc_ be the PropertyDescriptor{[[Value]]: _V_, [[Writable]]: *true*, [[Enumerable]]: *true*, [[Configurable]]: *true*}. + 1. Return ? _O_.[[DefineOwnProperty]](_P_, _newDesc_). + + +

This abstract operation creates a property whose attributes are set to the same defaults used for properties created by the ECMAScript language assignment operator. Normally, the property will not already exist. If it does exist and is not configurable or if _O_ is not extensible, [[DefineOwnProperty]] will return *false*.

+
+
+ + + +

CreateMethodProperty ( _O_, _P_, _V_ )

+

The abstract operation CreateMethodProperty is used to create a new own property of an object. The operation is called with arguments _O_, _P_, and _V_ where _O_ is the object, _P_ is the property key, and _V_ is the value for the property. This abstract operation performs the following steps:

+ + 1. Assert: Type(_O_) is Object. + 1. Assert: IsPropertyKey(_P_) is *true*. + 1. Let _newDesc_ be the PropertyDescriptor{[[Value]]: _V_, [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *true*}. + 1. Return ? _O_.[[DefineOwnProperty]](_P_, _newDesc_). + + +

This abstract operation creates a property whose attributes are set to the same defaults used for built-in methods and methods defined using class declaration syntax. Normally, the property will not already exist. If it does exist and is not configurable or if _O_ is not extensible, [[DefineOwnProperty]] will return *false*.

+
+
+ + + +

CreateDataPropertyOrThrow ( _O_, _P_, _V_ )

+

The abstract operation CreateDataPropertyOrThrow is used to create a new own property of an object. It throws a *TypeError* exception if the requested property update cannot be performed. The operation is called with arguments _O_, _P_, and _V_ where _O_ is the object, _P_ is the property key, and _V_ is the value for the property. This abstract operation performs the following steps:

+ + 1. Assert: Type(_O_) is Object. + 1. Assert: IsPropertyKey(_P_) is *true*. + 1. Let _success_ be ? CreateDataProperty(_O_, _P_, _V_). + 1. If _success_ is *false*, throw a *TypeError* exception. + 1. Return _success_. + + +

This abstract operation creates a property whose attributes are set to the same defaults used for properties created by the ECMAScript language assignment operator. Normally, the property will not already exist. If it does exist and is not configurable or if _O_ is not extensible, [[DefineOwnProperty]] will return *false* causing this operation to throw a *TypeError* exception.

+
+
+ + + +

DefinePropertyOrThrow ( _O_, _P_, _desc_ )

+

The abstract operation DefinePropertyOrThrow is used to call the [[DefineOwnProperty]] internal method of an object in a manner that will throw a *TypeError* exception if the requested property update cannot be performed. The operation is called with arguments _O_, _P_, and _desc_ where _O_ is the object, _P_ is the property key, and _desc_ is the Property Descriptor for the property. This abstract operation performs the following steps:

+ + 1. Assert: Type(_O_) is Object. + 1. Assert: IsPropertyKey(_P_) is *true*. + 1. Let _success_ be ? _O_.[[DefineOwnProperty]](_P_, _desc_). + 1. If _success_ is *false*, throw a *TypeError* exception. + 1. Return _success_. + +
+ + + +

DeletePropertyOrThrow ( _O_, _P_ )

+

The abstract operation DeletePropertyOrThrow is used to remove a specific own property of an object. It throws an exception if the property is not configurable. The operation is called with arguments _O_ and _P_ where _O_ is the object and _P_ is the property key. This abstract operation performs the following steps:

+ + 1. Assert: Type(_O_) is Object. + 1. Assert: IsPropertyKey(_P_) is *true*. + 1. Let _success_ be ? _O_.[[Delete]](_P_). + 1. If _success_ is *false*, throw a *TypeError* exception. + 1. Return _success_. + +
+ + + +

GetMethod ( _V_, _P_ )

+

The abstract operation GetMethod is used to get the value of a specific property of an ECMAScript language value when the value of the property is expected to be a function. The operation is called with arguments _V_ and _P_ where _V_ is the ECMAScript language value, _P_ is the property key. This abstract operation performs the following steps:

+ + 1. Assert: IsPropertyKey(_P_) is *true*. + 1. Let _func_ be ? GetV(_V_, _P_). + 1. If _func_ is either *undefined* or *null*, return *undefined*. + 1. If IsCallable(_func_) is *false*, throw a *TypeError* exception. + 1. Return _func_. + +
+ + + +

HasProperty ( _O_, _P_ )

+

The abstract operation HasProperty is used to determine whether an object has a property with the specified property key. The property may be either an own or inherited. A Boolean value is returned. The operation is called with arguments _O_ and _P_ where _O_ is the object and _P_ is the property key. This abstract operation performs the following steps:

+ + 1. Assert: Type(_O_) is Object. + 1. Assert: IsPropertyKey(_P_) is *true*. + 1. Return ? _O_.[[HasProperty]](_P_). + +
+ + + +

HasOwnProperty ( _O_, _P_ )

+

The abstract operation HasOwnProperty is used to determine whether an object has an own property with the specified property key. A Boolean value is returned. The operation is called with arguments _O_ and _P_ where _O_ is the object and _P_ is the property key. This abstract operation performs the following steps:

+ + 1. Assert: Type(_O_) is Object. + 1. Assert: IsPropertyKey(_P_) is *true*. + 1. Let _desc_ be ? _O_.[[GetOwnProperty]](_P_). + 1. If _desc_ is *undefined*, return *false*. + 1. Return *true*. + +
+ + + +

Call ( _F_, _V_ [ , _argumentsList_ ] )

+

The abstract operation Call is used to call the [[Call]] internal method of a function object. The operation is called with arguments _F_, _V_, and optionally _argumentsList_ where _F_ is the function object, _V_ is an ECMAScript language value that is the *this* value of the [[Call]], and _argumentsList_ is the value passed to the corresponding argument of the internal method. If _argumentsList_ is not present, a new empty List is used as its value. This abstract operation performs the following steps:

+ + 1. If _argumentsList_ is not present, set _argumentsList_ to a new empty List. + 1. If IsCallable(_F_) is *false*, throw a *TypeError* exception. + 1. Return ? _F_.[[Call]](_V_, _argumentsList_). + +
+ + + +

Construct ( _F_ [ , _argumentsList_ [ , _newTarget_ ]] )

+

The abstract operation Construct is used to call the [[Construct]] internal method of a function object. The operation is called with arguments _F_, and optionally _argumentsList_, and _newTarget_ where _F_ is the function object. _argumentsList_ and _newTarget_ are the values to be passed as the corresponding arguments of the internal method. If _argumentsList_ is not present, a new empty List is used as its value. If _newTarget_ is not present, _F_ is used as its value. This abstract operation performs the following steps:

+ + 1. If _newTarget_ is not present, set _newTarget_ to _F_. + 1. If _argumentsList_ is not present, set _argumentsList_ to a new empty List. + 1. Assert: IsConstructor(_F_) is *true*. + 1. Assert: IsConstructor(_newTarget_) is *true*. + 1. Return ? _F_.[[Construct]](_argumentsList_, _newTarget_). + + +

If _newTarget_ is not present, this operation is equivalent to: `new F(...argumentsList)`

+
+
+ + + +

SetIntegrityLevel ( _O_, _level_ )

+

The abstract operation SetIntegrityLevel is used to fix the set of own properties of an object. This abstract operation performs the following steps:

+ + 1. Assert: Type(_O_) is Object. + 1. Assert: _level_ is either `"sealed"` or `"frozen"`. + 1. Let _status_ be ? _O_.[[PreventExtensions]](). + 1. If _status_ is *false*, return *false*. + 1. Let _keys_ be ? _O_.[[OwnPropertyKeys]](). + 1. If _level_ is `"sealed"`, then + 1. For each element _k_ of _keys_, do + 1. Perform ? DefinePropertyOrThrow(_O_, _k_, PropertyDescriptor{[[Configurable]]: *false*}). + 1. Else _level_ is `"frozen"`, + 1. For each element _k_ of _keys_, do + 1. Let _currentDesc_ be ? _O_.[[GetOwnProperty]](_k_). + 1. If _currentDesc_ is not *undefined*, then + 1. If IsAccessorDescriptor(_currentDesc_) is *true*, then + 1. Let _desc_ be the PropertyDescriptor{[[Configurable]]: *false*}. + 1. Else, + 1. Let _desc_ be the PropertyDescriptor { [[Configurable]]: *false*, [[Writable]]: *false* }. + 1. Perform ? DefinePropertyOrThrow(_O_, _k_, _desc_). + 1. Return *true*. + +
+ + + +

TestIntegrityLevel ( _O_, _level_ )

+

The abstract operation TestIntegrityLevel is used to determine if the set of own properties of an object are fixed. This abstract operation performs the following steps:

+ + 1. Assert: Type(_O_) is Object. + 1. Assert: _level_ is either `"sealed"` or `"frozen"`. + 1. Let _status_ be ? IsExtensible(_O_). + 1. If _status_ is *true*, return *false*. + 1. NOTE: If the object is extensible, none of its properties are examined. + 1. Let _keys_ be ? _O_.[[OwnPropertyKeys]](). + 1. For each element _k_ of _keys_, do + 1. Let _currentDesc_ be ? _O_.[[GetOwnProperty]](_k_). + 1. If _currentDesc_ is not *undefined*, then + 1. If _currentDesc_.[[Configurable]] is *true*, return *false*. + 1. If _level_ is `"frozen"` and IsDataDescriptor(_currentDesc_) is *true*, then + 1. If _currentDesc_.[[Writable]] is *true*, return *false*. + 1. Return *true*. + +
+ + + +

CreateArrayFromList ( _elements_ )

+

The abstract operation CreateArrayFromList is used to create an Array object whose elements are provided by a List. This abstract operation performs the following steps:

+ + 1. Assert: _elements_ is a List whose elements are all ECMAScript language values. + 1. Let _array_ be ! ArrayCreate(0). + 1. Let _n_ be 0. + 1. For each element _e_ of _elements_, do + 1. Let _status_ be CreateDataProperty(_array_, ! ToString(_n_), _e_). + 1. Assert: _status_ is *true*. + 1. Increment _n_ by 1. + 1. Return _array_. + +
+ + + +

CreateListFromArrayLike ( _obj_ [ , _elementTypes_ ] )

+

The abstract operation CreateListFromArrayLike is used to create a List value whose elements are provided by the indexed properties of an array-like object, _obj_. The optional argument _elementTypes_ is a List containing the names of ECMAScript Language Types that are allowed for element values of the List that is created. This abstract operation performs the following steps:

+ + 1. If _elementTypes_ is not present, set _elementTypes_ to « Undefined, Null, Boolean, String, Symbol, Number, Object ». + 1. If Type(_obj_) is not Object, throw a *TypeError* exception. + 1. Let _len_ be ? ToLength(? Get(_obj_, `"length"`)). + 1. Let _list_ be a new empty List. + 1. Let _index_ be 0. + 1. Repeat, while _index_ < _len_ + 1. Let _indexName_ be ! ToString(_index_). + 1. Let _next_ be ? Get(_obj_, _indexName_). + 1. If Type(_next_) is not an element of _elementTypes_, throw a *TypeError* exception. + 1. Append _next_ as the last element of _list_. + 1. Set _index_ to _index_ + 1. + 1. Return _list_. + +
+ + + +

Invoke ( _V_, _P_ [ , _argumentsList_ ] )

+

The abstract operation Invoke is used to call a method property of an ECMAScript language value. The operation is called with arguments _V_, _P_, and optionally _argumentsList_ where _V_ serves as both the lookup point for the property and the *this* value of the call, _P_ is the property key, and _argumentsList_ is the list of arguments values passed to the method. If _argumentsList_ is not present, a new empty List is used as its value. This abstract operation performs the following steps:

+ + + 1. Assert: IsPropertyKey(_P_) is *true*. + 1. If _argumentsList_ is not present, set _argumentsList_ to a new empty List. + 1. Let _func_ be ? GetV(_V_, _P_). + 1. Return ? Call(_func_, _V_, _argumentsList_). + +
+ + + +

OrdinaryHasInstance ( _C_, _O_ )

+

The abstract operation OrdinaryHasInstance implements the default algorithm for determining if an object _O_ inherits from the instance object inheritance path provided by constructor _C_. This abstract operation performs the following steps:

+ + 1. If IsCallable(_C_) is *false*, return *false*. + 1. If _C_ has a [[BoundTargetFunction]] internal slot, then + 1. Let _BC_ be _C_.[[BoundTargetFunction]]. + 1. Return ? InstanceofOperator(_O_, _BC_). + 1. If Type(_O_) is not Object, return *false*. + 1. Let _P_ be ? Get(_C_, `"prototype"`). + 1. If Type(_P_) is not Object, throw a *TypeError* exception. + 1. Repeat, + 1. Set _O_ to ? _O_.[[GetPrototypeOf]](). + 1. If _O_ is *null*, return *false*. + 1. If SameValue(_P_, _O_) is *true*, return *true*. + +
+ + + +

SpeciesConstructor ( _O_, _defaultConstructor_ )

+

The abstract operation SpeciesConstructor is used to retrieve the constructor that should be used to create new objects that are derived from the argument object _O_. The _defaultConstructor_ argument is the constructor to use if a constructor @@species property cannot be found starting from _O_. This abstract operation performs the following steps:

+ + 1. Assert: Type(_O_) is Object. + 1. Let _C_ be ? Get(_O_, `"constructor"`). + 1. If _C_ is *undefined*, return _defaultConstructor_. + 1. If Type(_C_) is not Object, throw a *TypeError* exception. + 1. Let _S_ be ? Get(_C_, @@species). + 1. If _S_ is either *undefined* or *null*, return _defaultConstructor_. + 1. If IsConstructor(_S_) is *true*, return _S_. + 1. Throw a *TypeError* exception. + +
+ + +

EnumerableOwnProperties ( _O_, _kind_ )

+

When the abstract operation EnumerableOwnProperties is called with Object _O_ and String _kind_ the following steps are taken:

+ + 1. Assert: Type(_O_) is Object. + 1. Let _ownKeys_ be ? _O_.[[OwnPropertyKeys]](). + 1. Let _properties_ be a new empty List. + 1. For each element _key_ of _ownKeys_ in List order, do + 1. If Type(_key_) is String, then + 1. Let _desc_ be ? _O_.[[GetOwnProperty]](_key_). + 1. If _desc_ is not *undefined* and _desc_.[[Enumerable]] is *true*, then + 1. If _kind_ is *"key"*, append _key_ to _properties_. + 1. Else, + 1. Let _value_ be ? Get(_O_, _key_). + 1. If _kind_ is *"value"*, append _value_ to _properties_. + 1. Else, + 1. Assert: _kind_ is *"key+value"*. + 1. Let _entry_ be CreateArrayFromList(« _key_, _value_ »). + 1. Append _entry_ to _properties_. + 1. Order the elements of _properties_ so they are in the same relative order as would be produced by the Iterator that would be returned if the EnumerateObjectProperties internal method were invoked with _O_. + 1. Return _properties_. + +
+ + + +

GetFunctionRealm ( _obj_ )

+

The abstract operation GetFunctionRealm with argument _obj_ performs the following steps:

+ + 1. Assert: _obj_ is a callable object. + 1. If _obj_ has a [[Realm]] internal slot, then + 1. Return _obj_.[[Realm]]. + 1. If _obj_ is a Bound Function exotic object, then + 1. Let _target_ be _obj_.[[BoundTargetFunction]]. + 1. Return ? GetFunctionRealm(_target_). + 1. If _obj_ is a Proxy exotic object, then + 1. If _obj_.[[ProxyHandler]] is *null*, throw a *TypeError* exception. + 1. Let _proxyTarget_ be _obj_.[[ProxyTarget]]. + 1. Return ? GetFunctionRealm(_proxyTarget_). + 1. Return the current Realm Record. + + +

Step 5 will only be reached if _obj_ is a non-standard function exotic object that does not have a [[Realm]] internal slot.

+
+
+
\ No newline at end of file diff --git a/translated/isuues-16.html b/translated/isuues-16.html new file mode 100644 index 00000000000..f070c6c2f8d --- /dev/null +++ b/translated/isuues-16.html @@ -0,0 +1,131 @@ + +

Operations on Iterator Objects

+

See Common Iteration Interfaces ().

+ + + +

GetIterator ( _obj_ [ , _method_ ] )

+

The abstract operation GetIterator with argument _obj_ and optional argument _method_ performs the following steps:

+ + 1. If _method_ is not present, then + 1. Set _method_ to ? GetMethod(_obj_, @@iterator). + 1. Let _iterator_ be ? Call(_method_, _obj_). + 1. If Type(_iterator_) is not Object, throw a *TypeError* exception. + 1. Let _nextMethod_ be ? GetV(_iterator_, `"next"`). + 1. Let _iteratorRecord_ be Record {[[Iterator]]: _iterator_, [[NextMethod]]: _nextMethod_, [[Done]]: *false*}. + 1. Return _iteratorRecord_. + +
+ + + +

IteratorNext ( _iteratorRecord_ [ , _value_ ] )

+

The abstract operation IteratorNext with argument _iteratorRecord_ and optional argument _value_ performs the following steps:

+ + 1. If _value_ is not present, then + 1. Let _result_ be ? Call(_iteratorRecord_.[[NextMethod]], _iteratorRecord_.[[Iterator]], « »). + 1. Else, + 1. Let _result_ be ? Call(_iteratorRecord_.[[NextMethod]], _iteratorRecord_.[[Iterator]], « _value_ »). + 1. If Type(_result_) is not Object, throw a *TypeError* exception. + 1. Return _result_. + +
+ + + +

IteratorComplete ( _iterResult_ )

+

The abstract operation IteratorComplete with argument _iterResult_ performs the following steps:

+ + 1. Assert: Type(_iterResult_) is Object. + 1. Return ToBoolean(? Get(_iterResult_, `"done"`)). + +
+ + + +

IteratorValue ( _iterResult_ )

+

The abstract operation IteratorValue with argument _iterResult_ performs the following steps:

+ + 1. Assert: Type(_iterResult_) is Object. + 1. Return ? Get(_iterResult_, `"value"`). + +
+ + + +

IteratorStep ( _iteratorRecord_ )

+

The abstract operation IteratorStep with argument _iteratorRecord_ requests the next value from _iteratorRecord_.[[Iterator]] by calling _iteratorRecord_.[[NextMethod]] and returns either *false* indicating that the iterator has reached its end or the IteratorResult object if a next value is available. IteratorStep performs the following steps:

+ + 1. Let _result_ be ? IteratorNext(_iteratorRecord_). + 1. Let _done_ be ? IteratorComplete(_result_). + 1. If _done_ is *true*, return *false*. + 1. Return _result_. + +
+ + + +

IteratorClose ( _iteratorRecord_, _completion_ )

+

The abstract operation IteratorClose with arguments _iteratorRecord_ and _completion_ is used to notify an iterator that it should perform any actions it would normally perform when it has reached its completed state:

+ + 1. Assert: Type(_iteratorRecord_.[[Iterator]]) is Object. + 1. Assert: _completion_ is a Completion Record. + 1. Let _iterator_ be _iteratorRecord_.[[Iterator]]. + 1. Let _return_ be ? GetMethod(_iterator_, `"return"`). + 1. If _return_ is *undefined*, return Completion(_completion_). + 1. Let _innerResult_ be Call(_return_, _iterator_, « »). + 1. If _completion_.[[Type]] is ~throw~, return Completion(_completion_). + 1. If _innerResult_.[[Type]] is ~throw~, return Completion(_innerResult_). + 1. If Type(_innerResult_.[[Value]]) is not Object, throw a *TypeError* exception. + 1. Return Completion(_completion_). + +
+ + + +

CreateIterResultObject ( _value_, _done_ )

+

The abstract operation CreateIterResultObject with arguments _value_ and _done_ creates an object that supports the IteratorResult interface by performing the following steps:

+ + 1. Assert: Type(_done_) is Boolean. + 1. Let _obj_ be ObjectCreate(%ObjectPrototype%). + 1. Perform CreateDataProperty(_obj_, `"value"`, _value_). + 1. Perform CreateDataProperty(_obj_, `"done"`, _done_). + 1. Return _obj_. + +
+ + + +

CreateListIteratorRecord ( _list_ )

+

The abstract operation CreateListIteratorRecord with argument _list_ creates an Iterator () object record whose next method returns the successive elements of _list_. It performs the following steps:

+ + 1. Let _iterator_ be ObjectCreate(%IteratorPrototype%, « [[IteratedList]], [[ListIteratorNextIndex]] »). + 1. Set _iterator_.[[IteratedList]] to _list_. + 1. Set _iterator_.[[ListIteratorNextIndex]] to 0. + 1. Let _next_ be a new built-in function object as defined in ListIterator `next` (). + 1. Return Record { [[Iterator]]: _iterator_, [[NextMethod]]: _next_, [[Done]]: *false* }. + + +

The list iterator object is never directly accessible to ECMAScript code.

+
+ + + +

ListIterator next( )

+

The ListIterator `next` method is a standard built-in function object (clause ) that performs the following steps:

+ + 1. Let _O_ be the *this* value. + 1. Assert: Type(_O_) is Object. + 1. Assert: _O_ has an [[IteratedList]] internal slot. + 1. Let _list_ be _O_.[[IteratedList]]. + 1. Let _index_ be _O_.[[ListIteratorNextIndex]]. + 1. Let _len_ be the number of elements of _list_. + 1. If _index_ ≥ _len_, then + 1. Return CreateIterResultObject(*undefined*, *true*). + 1. Set _O_.[[ListIteratorNextIndex]] to _index_+1. + 1. Return CreateIterResultObject(_list_[_index_], *false*). + +
+
+
+
\ No newline at end of file