The abstract operation UNKNOWN takes UNPARSEABLE ARGUMENTS. input 引数を非 Object 型へ変換する。オブジェクトが複数の基本型へ変換可能な場合、オプションのヒント preferredType を使ってその型を優先できる。 It performs the following steps when called:
ヒントなしで ToPrimitive が呼び出された場合、一般的にはヒントが number であったかのように振る舞う。しかし、オブジェクトは %Symbol.toPrimitive% メソッドを定義することでこの挙動を上書きできる。本仕様で定義されるオブジェクトのうち既定の ToPrimitive 挙動を上書きするのは Date(21.4.4.45 参照)と Symbol オブジェクト(20.4.3.5 参照)のみである。Date はヒント不在を string として扱う。
7.1.1.1 OrdinaryToPrimitive ( O, hint )
The abstract operation OrdinaryToPrimitive takes arguments O (Object) and hint (string または number) and returns ECMAScript言語値を含む normal completion あるいは throw completion. It performs the following steps when called:
The abstract operation ToBoolean takes argument argument (ECMAScript言語値) and returns Boolean. argument を Boolean 型の値へ変換する。 It performs the following steps when called:
The abstract operation ToNumeric takes argument value (ECMAScript言語値) and returns Number または BigInt を含む normal completion あるいは throw completion. value を Number か BigInt に変換して返す。 It performs the following steps when called:
The abstract operation ToNumber takes argument argument (ECMAScript言語値) and returns Number を含む normal completion あるいは throw completion. argument を Number 型の値へ変換する。 It performs the following steps when called:
argument が Number なら argument を返す。
argument が Symbol か BigInt のいずれかなら TypeError 例外を投げる。
The abstract operation RoundMVResult takes argument n (数学的値) and returns Number. n を実装依存の方法で Number に変換する。この抽象操作において、桁は 0 でないか左側に 0 でない桁があり右側にも 0 でない桁がある場合に有効とみなされる。また「数学的値の表現が表す数学的値」とは「数学的値の10進表現」の逆写像とする。 It performs the following steps when called:
The abstract operation ToIntegerOrInfinity takes argument argument (ECMAScript言語値) and returns 整数, +∞, -∞ のいずれかを含む normal completion あるいは throw completion. argument を Number 値の小数部分切り捨て表現の整数、またはその Number 値が無限大の場合は +∞ / -∞ に変換する。 It performs the following steps when called:
𝔽(ToIntegerOrInfinity(x)) はいかなる x に対しても -0𝔽 を返さない。小数部の切り捨ては x を数学的値に変換した後に行われる。
7.1.6 ToInt32 ( argument )
The abstract operation ToInt32 takes argument argument (ECMAScript言語値) and returns 整数 Number を含む normal completion あるいは throw completion. argument を 𝔽(-231) から 𝔽(231 - 1) までの 232 個の整数 Number 値のいずれかに変換する。 It performs the following steps when called:
The abstract operation ToUint32 takes argument argument (ECMAScript言語値) and returns 整数 Number を含む normal completion あるいは throw completion. argument を +0𝔽 から 𝔽(232 - 1) までの 232 個の整数 Number 値のいずれかに変換する。 It performs the following steps when called:
The abstract operation ToInt16 takes argument argument (ECMAScript言語値) and returns 整数 Number を含む normal completion あるいは throw completion. argument を 𝔽(-215) から 𝔽(215 - 1) までの 216 個の整数 Number 値のいずれかに変換する。 It performs the following steps when called:
The abstract operation ToUint16 takes argument argument (ECMAScript言語値) and returns 整数 Number を含む normal completion あるいは throw completion. argument を +0𝔽 から 𝔽(216 - 1) までの 216 個の整数 Number 値のいずれかに変換する。 It performs the following steps when called:
The abstract operation ToInt8 takes argument argument (ECMAScript言語値) and returns 整数 Number を含む normal completion あるいは throw completion. argument を -128𝔽 から 127𝔽 までの 28 個の整数 Number 値のいずれかに変換する。 It performs the following steps when called:
The abstract operation ToUint8 takes argument argument (ECMAScript言語値) and returns 整数 Number を含む normal completion あるいは throw completion. argument を +0𝔽 から 255𝔽 までの 28 個の整数 Number 値のいずれかに変換する。 It performs the following steps when called:
The abstract operation ToUint8Clamp takes argument argument (ECMAScript言語値) and returns 整数 Number を含む normal completion あるいは throw completion. argument を +0𝔽 から 255𝔽 の範囲に丸め及びクランプし 28 個の整数 Number 値のいずれかにする。 It performs the following steps when called:
The abstract operation ToBigInt takes argument argument (ECMAScript言語値) and returns BigInt を含む normal completion あるいは throw completion. argument を BigInt 値へ変換する。Number からの暗黙変換が必要となる場合は例外を投げる。 It performs the following steps when called:
The abstract operation ToString takes argument argument (ECMAScript言語値) and returns String を含む normal completion あるいは throw completion. argument を String 型の値へ変換する。 It performs the following steps when called:
The abstract operation ToObject takes argument argument (ECMAScript言語値) and returns Object を含む normal completion あるいは throw completion. argument を Object 型の値へ変換する。 It performs the following steps when called:
The abstract operation ToLength takes argument argument (ECMAScript言語値) and returns 非負整数 Number を含む normal completion あるいは throw completion. argument を配列風オブジェクトの length として適した非負整数 Number にクランプし切り捨てる。 It performs the following steps when called:
The abstract operation CanonicalNumericIndexString takes argument argument (String) and returns Number または undefined. argument が "-0" であるか、ある Number 値 n について ToString(n) と正確に一致するなら、対応する Number 値を返す。それ以外は undefined を返す。 It performs the following steps when called:
The abstract operation RequireObjectCoercible takes argument argument (ECMAScript言語値) and returns unused を含む normal completion あるいは throw completion. argument が ToObject により Object へ変換できない値ならエラーを投げる。 It performs the following steps when called:
The abstract operation IsCallable takes argument argument (ECMAScript言語値) and returns Boolean. argument が [[Call]] 内部メソッドを持つ呼び出し可能関数か判定する。 It performs the following steps when called:
argument が Object でないなら false を返す。
argument が [[Call]] 内部メソッドを持つなら true を返す。
false を返す。
7.2.4 IsConstructor ( argument )
The abstract operation IsConstructor takes argument argument (ECMAScript言語値) and returns Boolean. argument が [[Construct]] 内部メソッドを持つ関数オブジェクトか判定する。 It performs the following steps when called:
argument が Object でないなら false を返す。
argument が [[Construct]] 内部メソッドを持つなら true を返す。
false を返す。
7.2.5 IsExtensible ( O )
The abstract operation IsExtensible takes argument O (Object) and returns Boolean を含む normal completion あるいは throw completion. O に追加のプロパティを加えられるか判定する。 It performs the following steps when called:
The abstract operation UNKNOWN takes UNPARSEABLE ARGUMENTS. string を 6.1.4 に記述される UTF-16 符号化コードポイント列として解釈し、それが well formed な UTF-16 シーケンスか判定する。 It performs the following steps when called:
len を string の長さとする。
k を 0 とする。
k < len の間繰り返す
cp を CodePointAt(string, k) とする。
cp.[[IsUnpairedSurrogate]] が true なら false を返す。
k を k + cp.[[CodeUnitCount]] に設定する。
true を返す。
7.2.8 SameType ( x, y )
The abstract operation SameType takes arguments x (ECMAScript言語値) and y (ECMAScript言語値) and returns Boolean. 2つの引数が同じ型かどうか判定する。 It performs the following steps when called:
x が undefined かつ y が undefined なら true を返す。
x が null かつ y が null なら true を返す。
x が Boolean かつ y が Boolean なら true を返す。
x が Number かつ y が Number なら true を返す。
x が BigInt かつ y が BigInt なら true を返す。
x が Symbol かつ y が Symbol なら true を返す。
x が String かつ y が String なら true を返す。
x が Object かつ y が Object なら true を返す。
false を返す。
7.2.9 SameValue ( x, y )
The abstract operation SameValue takes arguments x (ECMAScript言語値) and y (ECMAScript言語値) and returns Boolean. 2つの引数が同じ値かどうか判定する。 It performs the following steps when called:
このアルゴリズムは NaN 値を同等とみなし +0𝔽 と -0𝔽 を区別する点で IsStrictlyEqual アルゴリズムと異なる。
7.2.10 SameValueZero ( x, y )
The abstract operation SameValueZero takes arguments x (ECMAScript言語値) and y (ECMAScript言語値) and returns Boolean. 2つの引数が同じ値か(+0𝔽 と -0𝔽 の差異を無視して)判定する。 It performs the following steps when called:
The abstract operation SameValueNonNumber takes arguments x (Number でない ECMAScript言語値) and y (Number でない ECMAScript言語値) and returns Boolean. It performs the following steps when called:
The abstract operation IsLessThan takes arguments x (ECMAScript言語値), y (ECMAScript言語値), and LeftFirst (Boolean) and returns Boolean または undefined を含む normal completion あるいは throw completion. 比較 x < y の意味論を提供し、true / false / undefined(少なくとも一方が NaN を示す)を返す。LeftFirst フラグは副作用の可視性を伴う操作の順序を制御するために使われ、ECMAScript が左から右への評価順を規定しているため必要。LeftFirst が true のとき x は y より左に現れる式に対応し、false のときは逆でその場合操作は y が先に行われる。 It performs the following steps when called:
The abstract operation IsStrictlyEqual takes arguments x (ECMAScript言語値) and y (ECMAScript言語値) and returns Boolean. === 演算子の意味論を提供する。 It performs the following steps when called:
このアルゴリズムは符号付きゼロと NaN の扱いにおいて SameValue アルゴリズムと異なる。
7.3 オブジェクトに対する操作
7.3.1 MakeBasicObject ( internalSlotsList )
The abstract operation MakeBasicObject takes argument internalSlotsList (内部スロット名の List) and returns Object. 通常オブジェクトとエキゾチックオブジェクトを含む、アルゴリズム的に作られる全ての ECMAScript オブジェクトの起源である。全オブジェクト生成で共通する手順を切り出し、生成を集約する。 It performs the following steps when called:
The abstract operation Get takes arguments O (Object) and P (プロパティキー) and returns ECMAScript言語値を含む normal completion あるいは throw completion. オブジェクトの特定プロパティの値を取得するために使用される。 It performs the following steps when called:
The abstract operation Set takes arguments O (Object), P (プロパティキー), V (ECMAScript言語値), and Throw (Boolean) and returns unused を含む normal completion あるいは throw completion. オブジェクトの特定プロパティの値を設定するために用いられる。V は新しい値。 It performs the following steps when called:
The abstract operation CreateDataProperty takes arguments O (Object), P (プロパティキー), and V (ECMAScript言語値) and returns Boolean を含む normal completion あるいは throw completion. オブジェクトの新しい自身プロパティを生成するために使用される。 It performs the following steps when called:
この抽象操作は ECMAScript の代入演算子で作られるプロパティと同じ既定属性を持つプロパティを生成する。通常プロパティは未存在であり、存在し非設定可能または O が拡張不可能なら [[DefineOwnProperty]] は false を返す。
7.3.6 CreateDataPropertyOrThrow ( O, P, V )
The abstract operation CreateDataPropertyOrThrow takes arguments O (Object), P (プロパティキー), and V (ECMAScript言語値) and returns unused を含む normal completion あるいは throw completion. オブジェクトの新しい自身プロパティを生成する。要求された更新が行えない場合 TypeError を投げる。 It performs the following steps when called:
属性は代入演算子によって生成されるプロパティの既定値と同じ。存在済みで非設定可能または O が拡張不可能なら [[DefineOwnProperty]] は false を返し本操作は TypeError を投げる。
7.3.7 CreateNonEnumerableDataPropertyOrThrow ( O, P, V )
The abstract operation CreateNonEnumerableDataPropertyOrThrow takes arguments O (Object), P (プロパティキー), and V (ECMAScript言語値) and returns unused. 通常オブジェクトの列挙不可な新しい自身プロパティを生成する。 It performs the following steps when called:
The abstract operation DefinePropertyOrThrow takes arguments O (Object), P (プロパティキー), and desc (Property Descriptor) and returns unused を含む normal completion あるいは throw completion. オブジェクトの [[DefineOwnProperty]] 内部メソッドを呼び、要求された更新が行えない場合 TypeError を投げる。 It performs the following steps when called:
success を ? O.[[DefineOwnProperty]](P, desc) とする。
success が false なら TypeError 例外を投げる。
unused を返す。
7.3.9 DeletePropertyOrThrow ( O, P )
The abstract operation DeletePropertyOrThrow takes arguments O (Object) and P (プロパティキー) and returns unused を含む normal completion あるいは throw completion. オブジェクトの特定自身プロパティを削除する。プロパティが設定可能でない場合例外を投げる。 It performs the following steps when called:
success を ? O.[[Delete]](P) とする。
success が false なら TypeError 例外を投げる。
unused を返す。
7.3.10 GetMethod ( V, P )
The abstract operation GetMethod takes arguments V (ECMAScript言語値) and P (プロパティキー) and returns 関数オブジェクトまたは undefined を含む normal completion あるいは throw completion. プロパティ値が関数であることが期待される場合に ECMAScript 言語値の特定プロパティ値を取得する。 It performs the following steps when called:
The abstract operation HasProperty takes arguments O (Object) and P (プロパティキー) and returns Boolean を含む normal completion あるいは throw completion. オブジェクトが指定キーのプロパティ(自身または継承)を持つか判定する。 It performs the following steps when called:
? O.[[HasProperty]](P) を返す。
7.3.12 HasOwnProperty ( O, P )
The abstract operation HasOwnProperty takes arguments O (Object) and P (プロパティキー) and returns Boolean を含む normal completion あるいは throw completion. オブジェクトが指定キーの自身プロパティを持つか判定する。 It performs the following steps when called:
The abstract operation UNKNOWN takes UNPARSEABLE ARGUMENTS. 関数オブジェクトの [[Call]] 内部メソッドを呼ぶために用いる。F が関数、V が this 値、argumentsList が内部メソッドに渡す引数列。argumentsList が無ければ空の新 List を用いる。 It performs the following steps when called:
argumentsList が存在しないなら argumentsList を空の新 List に設定する。
The abstract operation UNKNOWN takes UNPARSEABLE ARGUMENTS. 関数オブジェクトの [[Construct]] 内部メソッドを呼ぶために用いる。argumentsList と newTarget は内部メソッドに対応する引数として渡される。argumentsList が無い場合空の新 List、newTarget が無い場合 F を用いる。 It performs the following steps when called:
newTarget が存在しないなら newTarget を F に設定する。
argumentsList が存在しないなら argumentsList を空の新 List に設定する。
? F.[[Construct]](argumentsList, newTarget) を返す。
Note
newTarget が無い場合、この操作は new F(...argumentsList) と同等。
7.3.15 SetIntegrityLevel ( O, level )
The abstract operation SetIntegrityLevel takes arguments O (Object) and level (sealed または frozen) and returns Boolean を含む normal completion あるいは throw completion. オブジェクトの自身プロパティ集合を固定するために使用。 It performs the following steps when called:
The abstract operation TestIntegrityLevel takes arguments O (Object) and level (sealed または frozen) and returns Boolean を含む normal completion あるいは throw completion. オブジェクトの自身プロパティ集合が固定されているか判定する。 It performs the following steps when called:
The abstract operation CreateArrayFromList takes argument elements (ECMAScript言語値の List) and returns Array. 要素が elements によって与えられる Array を生成する。 It performs the following steps when called:
The abstract operation LengthOfArrayLike takes argument obj (Object) and returns 非負整数を含む normal completion あるいは throw completion. 配列風オブジェクトの "length" プロパティの値を返す。 It performs the following steps when called:
7.3.19
CreateListFromArrayLike (
obj: ECMAScript言語値,
省略可能 validElementTypes: all または property-key,
): ECMAScript言語値の List を含む normal completion あるいは throw completion
The abstract operation UNKNOWN takes UNPARSEABLE ARGUMENTS. obj のインデックス付きプロパティから要素を取得して List 値を生成する。validElementTypes は要素として許可される値の型を示す。 It performs the following steps when called:
validElementTypes が存在しないなら validElementTypes を all とする。
The abstract operation UNKNOWN takes UNPARSEABLE ARGUMENTS. ECMAScript言語値のメソッドプロパティを呼び出すために用いる。V はプロパティ探索点かつ呼び出しの this 値。argumentsList はメソッドに渡す引数列。省略時は空 List。 It performs the following steps when called:
argumentsList が存在しないなら argumentsList を空の新 List に設定する。
The abstract operation OrdinaryHasInstance takes arguments C (ECMAScript言語値) and O (ECMAScript言語値) and returns Boolean を含む normal completion あるいは throw completion. O が C により提供されるインスタンスオブジェクト継承パスから継承しているかの既定アルゴリズムを実装する。 It performs the following steps when called:
7.3.22 SpeciesConstructor ( O, defaultConstructor )
The abstract operation SpeciesConstructor takes arguments O (Object) and defaultConstructor (constructor) and returns constructor を含む normal completion あるいは throw completion. O から派生する新オブジェクト生成に用いるべきコンストラクタを取得する。defaultConstructor は %Symbol.species% プロパティが O から辿れない場合に使用するコンストラクタ。 It performs the following steps when called:
The abstract operation EnumerableOwnProperties takes arguments O (Object) and kind (key, value, key+value) and returns ECMAScript言語値の List を含む normal completion あるいは throw completion. It performs the following steps when called:
The abstract operation CopyDataProperties takes arguments target (Object), source (ECMAScript言語値), and excludedItems (プロパティキーの List) and returns unused を含む normal completion あるいは throw completion. It performs the following steps when called:
The abstract operation PrivateElementFind takes arguments O (Object) and P (Private Name) and returns PrivateElement または empty. It performs the following steps when called:
O.[[PrivateElements]] が PrivateElementpe を含み pe.[[Key]] が P であるなら
The abstract operation PrivateMethodOrAccessorAdd takes arguments O (Object) and method (PrivateElement) and returns unused を含む normal completion あるいは throw completion. It performs the following steps when called:
7.3.33 InitializeInstanceElements ( O, constructor )
The abstract operation InitializeInstanceElements takes arguments O (Object) and constructor (ECMAScript 関数オブジェクト) and returns unused を含む normal completion あるいは throw completion. It performs the following steps when called:
7.3.34 AddValueToKeyedGroup ( groups, key, value )
The abstract operation AddValueToKeyedGroup takes arguments groups ([[Key]] (ECMAScript言語値) と [[Elements]] (ECMAScript言語値の List) フィールドを持つ Record の List), key (ECMAScript言語値), and value (ECMAScript言語値) and returns unused. It performs the following steps when called:
group を Record { [[Key]]: key, [[Elements]]: « value » } とする。
group を groups に追加する。
unused を返す。
7.3.35 GroupBy ( items, callback, keyCoercion )
The abstract operation GroupBy takes arguments items (ECMAScript言語値), callback (ECMAScript言語値), and keyCoercion (property または collection) and returns [[Key]] と [[Elements]] フィールドを持つ Record の List を含む normal completion あるいは throw completion. It performs the following steps when called:
The abstract operation GetIteratorFlattenable takes arguments obj (ECMAScript言語値) and primitiveHandling (iterate-string-primitives または reject-primitives) and returns Iterator Record を含む normal completion あるいは throw completion. It performs the following steps when called:
The abstract operation IteratorComplete takes argument iteratorResult (Object) and returns Boolean を含む normal completion あるいは throw completion. It performs the following steps when called:
The abstract operation IteratorValue takes argument iteratorResult (Object) and returns ECMAScript言語値を含む normal completion あるいは throw completion. It performs the following steps when called:
The abstract operation IteratorStep takes argument iteratorRecord (Iterator Record) and returns Object または done を含む normal completion あるいは throw completion. iteratorRecord.[[NextMethod]] を呼び次の値を要求し、イテレータが終端なら done を、そうでなければ次の値を含む IteratorResult オブジェクトを返す。 It performs the following steps when called:
The abstract operation IteratorStepValue takes argument iteratorRecord (Iterator Record) and returns ECMAScript言語値 または done を含む normal completion あるいは throw completion. iteratorRecord.[[NextMethod]] を呼び次の値を要求し、イテレータ終端なら done、値があれば IteratorResult からその値を返す。 It performs the following steps when called:
The abstract operation IteratorClose takes arguments iteratorRecord (Iterator Record) and completion (Completion Record) and returns Completion Record. イテレータが完了状態に達した際に通常行う処理を実行するよう通知する。 It performs the following steps when called:
The abstract operation AsyncIteratorClose takes arguments iteratorRecord (Iterator Record) and completion (Completion Record) and returns Completion Record. 非同期イテレータが完了状態に達した際に通常行う処理を実行するよう通知する。 It performs the following steps when called:
The abstract operation CreateIteratorResultObject takes arguments value (ECMAScript言語値) and done (Boolean) and returns IteratorResult インターフェイスに準拠する Object. IteratorResult インターフェイスに準拠するオブジェクトを生成する。 It performs the following steps when called:
The abstract operation CreateListIteratorRecord takes argument list (ECMAScript言語値の List) and returns Iterator Record. list の連続要素を返す [[NextMethod]] を持つ Iterator Record を生成する。 It performs the following steps when called:
closure をパラメータ無しで list をキャプチャし呼び出し時に次を行う新しい Abstract Closure とする: