?um/p1-90`この仕様内のアルゴリズムは、それぞれに関連付けられた型を持つ値を操作します。可能な値の型は、この節で定義されるものに正確に限られます。型はさらに
ECMAScript言語型は、ECMAScriptプログラマーがECMAScript言語を使用して直接操作する値に対応します。ECMAScript言語型はUndefined、Null、Boolean、String、Symbol、Number、BigInt、およびObjectです。ECMAScript言語値とは、ECMAScript言語型によって特徴付けられる値です。
Undefined型は、
Null型は、
Boolean型は、
String型は、最大長253 - 1要素までの、0個以上の16ビット符号なし整数値(“要素”)のすべての順序列の集合です。String型は一般に、実行中のECMAScriptプログラム内でテキストデータを表すために使用され、その場合、String内の各要素はUTF-16コード単位値として扱われます。各要素は、その列内の位置を占めるものと見なされます。これらの位置は非負整数でインデックス付けされます。最初の要素(存在する場合)はindex 0にあり、次の要素(存在する場合)はindex 1にあり、以下同様です。Stringの長さは、その中の要素(すなわち16ビット値)の数です。空のStringは長さ0であり、したがって要素を含みません。
Stringの内容を解釈しないECMAScript操作は、それ以上の意味論を適用しません。String値を解釈する操作は、各要素を単一のUTF-16コード単位として扱います。しかし、ECMAScriptはこれらのコード単位の値や相互関係を制限しないため、Stringの内容をUTF-16でエンコードされたUnicode符号位置列としてさらに解釈する操作は、不正な部分列を考慮しなければなりません。そのような操作は、0xD800から0xDBFFまでの包含区間内の数値を持つすべてのコード単位(Unicode Standardによってleading surrogate、またはより正式にはhigh-surrogate code unitとして定義される)と、0xDC00から0xDFFFまでの包含区間内の数値を持つすべてのコード単位(trailing surrogate、またはより正式にはlow-surrogate code unitとして定義される)に対して、以下の規則を使用して特別な扱いを適用します:
関数String.prototype.normalize(String.prototype.localeCompare(
この設計の根拠は、Stringsの実装を可能な限り単純かつ高性能に保つことでした。
この仕様では、“A, B, ...のstring-concatenation”(各argumentがString値、コード単位、またはコード単位列である場合)という句は、各argumentのコード単位(順序どおり)の連結(順序どおり)であるコード単位列を持つString値を表します。
“inclusiveStartからexclusiveEndまでのstringのsubstring”(stringがString値またはコード単位列であり、inclusiveStartおよびexclusiveEndが整数である場合)という句は、index inclusiveStartから始まりindex exclusiveEndの直前で終わる、stringの連続するコード単位からなるString値を表します(inclusiveStart = exclusiveEndの場合は空のString)。"to"接尾辞が省略された場合、stringの長さがexclusiveEndの値として使用されます。
“the ASCII word characters”という句は、Unicode Basic Latinブロック内のすべての文字および数字にU+005F(LOW LINE)を加えたもののみからなる、以下のString値を表します:
歴史的な理由により、これはさまざまなアルゴリズムにおいて重要性を持ちます。
The abstract operation StringIndexOf takes arguments string (a String), searchValue (a String), and fromIndex (a non-negative
searchValueが空のStringであり、fromIndex ≤ stringの長さである場合、このアルゴリズムはfromIndexを返します。空のStringは、最後のコード単位の後を含め、文字列内のすべての位置で実質的に見つかります。
このアルゴリズムは、fromIndex + searchValueの長さ > stringの長さである場合、常に
The abstract operation StringLastIndexOf takes arguments string (a String), searchValue (a String), and fromIndex (a non-negative
searchValueが空のStringである場合、このアルゴリズムはfromIndexを返します。空のStringは、最後のコード単位の後を含め、文字列内のすべての位置で実質的に見つかります。
Symbol型は、Objectプロパティのキーとして使用できるすべての非String値の集合です(
各Symbolは一意で不変です。
各Symbolは不変の[[Description]] internal slotを持ち、その値はStringまたは
well-known symbolsは、この仕様のアルゴリズムによって明示的に参照される組み込みSymbol値です。それらは通常、仕様アルゴリズムの拡張点として機能する値を持つプロパティのキーとして使用されます。別途指定されない限り、well-known symbols値はすべての
この仕様内では、well-known symbolは、
%Symbol.name%を使用する箇所に@@nameという形式の記法を使用していました。特に、以下の名前が使用されていました:@@asyncIterator、@@hasInstance、@@isConcatSpreadable、@@| 仕様名 | [[Description]] | 値と目的 |
|---|---|---|
| %Symbol.asyncDispose% |
|
オブジェクト上で非同期にリソースのクリーンアップを実行するメソッド。それを含むスコープの評価が完了したときに、AsyncDisposableStack オブジェクトおよび await using 宣言によって呼び出される。
|
| %Symbol.asyncIterator% |
|
オブジェクトのデフォルト非同期イテレータを返すメソッド。for-await-of 文のセマンティクスによって呼び出される。
|
| %Symbol.dispose% |
|
オブジェクト上で明示的なリソースのクリーンアップを実行するメソッド。それを含むスコープの評価が完了したときに、DisposableStack オブジェクト、AsyncDisposableStack オブジェクト、および using 宣言によって呼び出される。
|
| %Symbol.hasInstance% |
|
コンストラクタオブジェクトが、あるオブジェクトをそのコンストラクタのインスタンスの1つとして認識するかどうかを判定するメソッド。instanceof 演算子のセマンティクスによって呼び出される。
|
| %Symbol.isConcatSpreadable% |
|
true の場合、オブジェクトが Array.prototype.concat |
| %Symbol.iterator% |
|
オブジェクトのデフォルトイテレータを返すメソッド。for-of 文のセマンティクスによって呼び出される。 |
| %Symbol.match% |
|
正規表現を文字列に照合する正規表現メソッド。String.prototype.match |
| %Symbol.matchAll% |
|
文字列に対する正規表現の一致を yield するイテレータを返す正規表現メソッド。String.prototype.matchAll |
| %Symbol.replace% |
|
文字列の一致した部分文字列を置換する正規表現メソッド。String.prototype.replace |
| %Symbol.search% |
|
正規表現に一致する文字列内のインデックスを返す正規表現メソッド。String.prototype.search |
| %Symbol.species% |
|
派生オブジェクトを作成するために使用されるコンストラクタ関数である、関数値のプロパティ。 |
| %Symbol.split% |
|
正規表現に一致するインデックスで文字列を分割する正規表現メソッド。String.prototype.split |
| %Symbol.toPrimitive% |
|
オブジェクトを対応するプリミティブ値へ変換するメソッド。 |
| %Symbol.toStringTag% |
|
オブジェクトのデフォルトの文字列表現を作成する際に使用される String 値のプロパティ。組み込みメソッド Object.prototype.toString |
| %Symbol.unscopables% |
|
自身および継承されたプロパティ名が、関連付けられたオブジェクトの with 環境束縛から除外されるプロパティ名である、オブジェクト値のプロパティ。
|
ECMAScriptには2つの組み込み数値型、NumberとBigIntがあります。以下の抽象操作は、これらの数値型上で定義されます。“Result”列は戻り型を示し、その操作の一部の呼び出しが
数値型は一般に、精度の損失や切り捨てなしには変換できないため、ECMAScript言語はこれらの型間の暗黙変換を提供しません。プログラマーは、別の型を必要とする関数を呼び出すとき、型間で変換するためにNumberおよびBigInt関数を明示的に呼び出さなければなりません。
ECMAScriptの第1版およびその後の版は、特定の演算子について、精度を失ったり切り捨てたりする可能性のある暗黙の数値変換を提供してきました。これらのlegacy implicit conversionsは後方互換性のために維持されていますが、プログラマーのエラーの機会を最小化し、将来の版における一般化されたvalue typesの選択肢を残すため、BigIntには提供されません。
Number型は、正確に18,437,736,874,454,810,627個(すなわちNaNによって生成されることに注意してください。)一部の実装では、外部コードがさまざまなNaN値の違いを検出できる場合がありますが、そのような振る舞いは
他に2つの特別な値があり、+Infinity(または単にInfinity)および-Infinityによって生成されることに注意してください。)
その他の18,437,736,874,454,810,624個(すなわち
+0(または単に0)および-0によって生成されることに注意してください。)
18,437,736,874,454,810,622個(すなわち
そのうち18,428,729,675,200,069,632個(すなわち
ここでsは1または-1、mは252(inclusive)から253(exclusive)までの
残りの9,007,199,254,740,990個(すなわち
ここでsは1または-1、mは0(exclusive)から252(exclusive)までの
大きさが253以下であるすべての正および負の
有限数は、非ゼロであり、それを表現するために使用される
この仕様では、“xのNumber value for”という句は、xが正確な実数数学量(πのような無理数であってもよい)を表す場合、以下の方法で選ばれたNumber値を意味します。Number型のすべての
+∞のNumber valueは
一部のECMAScript演算子は、
The abstract operation Number::unaryMinus takes argument number (a Number) and returns a Number. It performs the following steps when called:
The abstract operation Number::bitwiseNOT takes argument number (a Number) and returns an
The abstract operation Number::exponentiate takes arguments base (a Number) and exponent (a Number) and returns a Number. これはbaseをexponent乗した結果を表す
baseが** exponentの結果は、
The abstract operation Number::multiply takes arguments x (a Number) and y (a Number) and returns a Number.
有限精度の乗算は可換ですが、常に結合的であるとは限りません。
The abstract operation Number::divide takes arguments x (a Number) and y (a Number) and returns a Number.
The abstract operation Number::remainder takes arguments numerator (a Number) and denominator (a Number) and returns a Number. numeratorをdividend、denominatorをdivisorとする、そのオペランドの暗黙の除算からremainderを生成します。 It performs the following steps when called:
CおよびC++では、remainder演算子はintegral operandsのみを受け入れます。ECMAScriptでは、floating-point operandsも受け入れます。
%演算子によって計算されるfloating-point remainder操作の結果は、%を、JavaのThe abstract operation Number::add takes arguments x (a Number) and y (a Number) and returns a Number.
有限精度の加算は可換ですが、常に結合的であるとは限りません。
The abstract operation Number::subtract takes arguments x (a Number) and y (a Number) and returns a Number. 減算を実行し、そのオペランドの差を生成します。xはminuendであり、yはsubtrahendです。 It performs the following steps when called:
x - yは常にx + (-y)と同じ結果を生成します。
The abstract operation Number::leftShift takes arguments x (a Number) and y (a Number) and returns an
The abstract operation Number::signedRightShift takes arguments x (a Number) and y (a Number) and returns an
The abstract operation Number::unsignedRightShift takes arguments x (a Number) and y (a Number) and returns an
The abstract operation Number::lessThan takes arguments x (a Number) and y (a Number) and returns a Boolean or
The abstract operation Number::equal takes arguments x (a Number) and y (a Number) and returns a Boolean. It performs the following steps when called:
The abstract operation Number::sameValue takes arguments x (a Number) and y (a Number) and returns a Boolean. It performs the following steps when called:
The abstract operation Number::sameValueZero takes arguments x (a Number) and y (a Number) and returns a Boolean. It performs the following steps when called:
The abstract operation NumberBitwiseOp takes arguments op (&, ^, or |), x (a Number), and y (a Number) and returns an
&なら、^なら、|である。The abstract operation Number::bitwiseAND takes arguments x (a Number) and y (a Number) and returns an
&, x, y)を返す。The abstract operation Number::bitwiseXOR takes arguments x (a Number) and y (a Number) and returns an
^, x, y)を返す。The abstract operation Number::bitwiseOR takes arguments x (a Number) and y (a Number) and returns an
|, x, y)を返す。The abstract operation Number::toString takes arguments x (a Number) and radix (an
1.2e+3のような科学的E記法を使用して表されます。ECMAScriptの実装者は、floating-point numbersのbinary-to-decimal変換についてDavid M. Gayが書いた論文およびコードを有用と感じるかもしれません:
Gay, David M. Correctly Rounded Binary-Decimal and Decimal-Binary Conversions. Numerical Analysis, Manuscript 90-10. AT&T Bell Laboratories (Murray Hill, New Jersey). 30 November 1990. Available as
https://ampl.com/_archive/first-website/REFS/rounding.pdf. 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.
BigInt型は
The abstract operation BigInt::unaryMinus takes argument bigint (a BigInt) and returns a BigInt. It performs the following steps when called:
The abstract operation BigInt::bitwiseNOT takes argument bigint (a BigInt) and returns a BigInt. bigintのone's complementを返します。 It performs the following steps when called:
The abstract operation BigInt::exponentiate takes arguments base (a BigInt) and exponent (a BigInt) and returns either a
The abstract operation BigInt::multiply takes arguments x (a BigInt) and y (a BigInt) and returns a BigInt. It performs the following steps when called:
The abstract operation BigInt::divide takes arguments x (a BigInt) and y (a BigInt) and returns either a
The abstract operation BigInt::remainder takes arguments numerator (a BigInt) and denominator (a BigInt) and returns either a
The abstract operation BigInt::add takes arguments x (a BigInt) and y (a BigInt) and returns a BigInt. It performs the following steps when called:
The abstract operation BigInt::subtract takes arguments x (a BigInt) and y (a BigInt) and returns a BigInt. It performs the following steps when called:
The abstract operation BigInt::leftShift takes arguments x (a BigInt) and y (a BigInt) and returns a BigInt. It performs the following steps when called:
The abstract operation BigInt::signedRightShift takes arguments x (a BigInt) and y (a BigInt) and returns a BigInt. It performs the following steps when called:
The abstract operation BigInt::unsignedRightShift takes arguments x (a BigInt) and y (a BigInt) and returns a
The abstract operation BigInt::lessThan takes arguments x (a BigInt) and y (a BigInt) and returns a Boolean. It performs the following steps when called:
The abstract operation BigInt::equal takes arguments x (a BigInt) and y (a BigInt) and returns a Boolean. It performs the following steps when called:
The abstract operation BinaryAnd takes arguments x (0 or 1) and y (0 or 1) and returns 0 or 1. It performs the following steps when called:
The abstract operation BinaryOr takes arguments x (0 or 1) and y (0 or 1) and returns 0 or 1. It performs the following steps when called:
The abstract operation BinaryXor takes arguments x (0 or 1) and y (0 or 1) and returns 0 or 1. It performs the following steps when called:
The abstract operation BigIntBitwiseOp takes arguments op (&, ^, or |), x (a BigInt), and y (a BigInt) and returns a BigInt. It performs the following steps when called:
&なら、|なら、The abstract operation BigInt::bitwiseAND takes arguments x (a BigInt) and y (a BigInt) and returns a BigInt. It performs the following steps when called:
&, x, y)を返す。The abstract operation BigInt::bitwiseXOR takes arguments x (a BigInt) and y (a BigInt) and returns a BigInt. It performs the following steps when called:
^, x, y)を返す。The abstract operation BigInt::bitwiseOR takes arguments x (a BigInt) and y (a BigInt) and returns a BigInt. It performs the following steps when called:
|, x, y)を返す。The abstract operation BigInt::toString takes arguments x (a BigInt) and radix (an
Object型の各インスタンス(単に“Object”とも呼ばれる)は、プロパティの集合を表します。各プロパティは、data propertyまたはaccessor propertyのいずれかです:
オブジェクトのプロパティは、
integer indexは、
すべての非負の
すべてのオブジェクトは論理的にはプロパティの集合ですが、そのプロパティへのアクセスおよび操作の意味論が異なる複数の形式のオブジェクトがあります。複数の形式のオブジェクトの定義については、
加えて、一部のオブジェクトはcallableです。これらはfunctionsまたは
属性は、この仕様において、
| 属性名 | それが存在するプロパティの種類 | 値のドメイン | Default Value | 説明 |
|---|---|---|---|---|
| [[Value]] |
|
|
|
プロパティのgetアクセスによって取得される値。 |
| [[Writable]] |
|
Boolean |
|
|
| [[Get]] |
|
Objectまたは |
|
値がObjectである場合、それは |
| [[Set]] |
|
Objectまたは |
|
値がObjectである場合、それは |
| [[Enumerable]] |
|
Boolean |
|
|
| [[Configurable]] |
|
Boolean |
|
|
ECMAScriptにおけるオブジェクトの実際の意味論は、internal methodsと呼ばれるアルゴリズムを通じて指定されます。ECMAScriptエンジン内の各オブジェクトは、その実行時の振る舞いを定義するinternal methodsの集合に関連付けられています。これらのinternal methodsはECMAScript言語の一部ではありません。これらは、この仕様によって説明目的でのみ定義されます。しかし、ECMAScriptの実装内の各オブジェクトは、それに関連付けられたinternal methodsによって指定されるとおりに振る舞わなければなりません。これが実現される正確な方法は実装によって決定されます。
Internal method namesは多態的です。これは、共通のinternal method nameが異なるオブジェクト値に対して呼び出されたとき、それらが異なるアルゴリズムを実行し得ることを意味します。internal methodが呼び出される実際のオブジェクトは、その呼び出しの“target”です。実行時に、あるアルゴリズムの実装が、そのオブジェクトがサポートしていないinternal methodを使用しようとした場合、
Internal slotsは、オブジェクト、Symbols、または
すべてのオブジェクトは[[PrivateElements]]という名前のinternal slotを持ち、これは
Internal methodsおよびinternal slotsは、この仕様内では二重角括弧[[ ]]で囲まれた名前を使用して識別されます。
ordinary objectは、以下のすべての基準を満たすオブジェクトです:
exotic objectは、
この仕様は、
internal methodは、そのparametersに加えて、常にそのmethod invocationのtargetであるオブジェクトへアクセスできます。
internal methodは暗黙的に
| Internal Method | Signature | 説明 |
|---|---|---|
| [[GetPrototypeOf]] | ( ) → Object | Null |
このオブジェクトにinherited propertiesを提供するオブジェクトを決定します。 |
| [[SetPrototypeOf]] | (Object | Null) → Boolean |
このオブジェクトを、inherited propertiesを提供する別のオブジェクトに関連付けます。 |
| [[IsExtensible]] | ( ) → Boolean | このオブジェクトに追加のプロパティを加えることが許可されているかどうかを決定します。 |
| [[PreventExtensions]] | ( ) → Boolean |
このオブジェクトに新しいプロパティを追加できるかどうかを制御します。操作が成功した場合は |
| [[GetOwnProperty]] |
(propertyKey) → Undefined | |
キーがpropertyKeyであるこのオブジェクトのown propertyについて |
| [[DefineOwnProperty]] | (propertyKey, propertyDesc) → Boolean |
キーがpropertyKeyであるown propertyを作成または変更し、propertyDescによって記述される状態を持たせます。そのプロパティが正常に作成/更新された場合は |
| [[HasProperty]] | (propertyKey) → Boolean | このオブジェクトが、キーがpropertyKeyであるownまたはinherited propertyのいずれかを既に持っているかどうかを示すBoolean値を返します。 |
| [[Get]] | (propertyKey, receiver) → any |
このオブジェクトから、キーがpropertyKeyであるプロパティの値を返します。プロパティ値を取得するために何らかのECMAScriptコードを実行する必要がある場合、receiverはそのコードを評価する際の |
| [[Set]] | (propertyKey, value, receiver) → Boolean |
キーがpropertyKeyであるプロパティの値をvalueに設定します。プロパティ値を設定するために何らかのECMAScriptコードを実行する必要がある場合、receiverはそのコードを評価する際の |
| [[Delete]] | (propertyKey) → Boolean |
キーがpropertyKeyであるown propertyをこのオブジェクトから削除します。プロパティが削除されず、まだ存在している場合は |
| [[OwnPropertyKeys]] |
( ) → |
要素がそのオブジェクトのすべてのown |
| Internal Method | Signature | 説明 |
|---|---|---|
| [[Call]] |
(any, a |
このオブジェクトに関連付けられたコードを実行します。function call expressionを通じて呼び出されます。internal methodへのargumentsは、 |
| [[Construct]] |
(a |
オブジェクトを作成します。new演算子またはsuper呼び出しを通じて呼び出されます。internal methodへの最初のargumentは、super呼び出しのargumentsを要素とするnew演算子が最初に適用されたオブジェクトです。このinternal methodを実装するオブジェクトは |
ECMAScriptエンジンのObjectsのInternal Methodsは、以下で指定される不変条件の一覧に従わなければなりません。通常のECMAScript Objectsおよびこの仕様におけるすべてのstandard
実装が提供する任意の
実装は、その不変条件を強制せずにessential internal methodsの機能を実装する代替インターフェイスを提供するなど、いかなる方法でもこれらの不変条件が迂回されることを許してはなりません。
任意のinternal methodによって返される値は、以下のいずれかを持つ
internal methodは、
オブジェクトのprototype chainは有限長であるべきです(すなわち、任意のオブジェクトから開始して、[[GetPrototypeOf]] internal methodをその結果に再帰的に適用すると、最終的に値
3番目の不変条件の結果として、あるプロパティが
well-known intrinsicsは、この仕様のアルゴリズムによって明示的に参照される組み込みオブジェクトであり、通常
この仕様内では、%name%のような参照は、current
| 組込み名 | グローバル名 | ECMAScript 言語での関連付け |
|---|---|---|
|
|
|
AggregateError |
|
|
|
Array |
|
|
|
ArrayBuffer |
|
|
|
|
|
|
|
AsyncDisposableStack |
|
|
Async-from-Sync |
|
|
|
async 関数オブジェクトの |
|
|
|
async generator 関数オブジェクトの |
|
|
|
async generator オブジェクトのプロトタイプ ( |
|
|
|
すべての標準組込み |
|
|
|
|
Atomics オブジェクト ( |
|
|
|
BigInt |
|
|
|
BigInt64Array |
|
|
|
BigUint64Array |
|
|
|
Boolean |
|
|
|
DataView |
|
|
|
Date |
|
|
|
decodeURI 関数 ( |
|
|
|
decodeURIComponent 関数 ( |
|
|
|
DisposableStack |
|
|
|
encodeURI 関数 ( |
|
|
|
encodeURIComponent 関数 ( |
|
|
|
Error |
|
|
|
eval 関数 ( |
|
|
|
EvalError |
|
|
|
FinalizationRegistry |
|
|
|
Float16Array |
|
|
|
Float32Array |
|
|
|
Float64Array |
|
|
|
|
|
|
|
Function |
|
|
generator 関数オブジェクトの |
|
|
|
generator オブジェクトのプロトタイプ ( |
|
|
|
|
Int8Array |
|
|
|
Int16Array |
|
|
|
Int32Array |
|
|
|
isFinite 関数 ( |
|
|
|
isNaN 関数 ( |
|
|
|
Iterator |
|
|
|
|
|
|
|
JSON オブジェクト ( |
|
|
|
Map |
|
|
|
|
|
|
|
Math オブジェクト ( |
|
|
|
Number |
|
|
|
Object |
|
|
|
parseFloat 関数 ( |
|
|
|
parseInt 関数 ( |
|
|
|
Promise |
|
|
|
Proxy |
|
|
|
RangeError |
|
|
|
ReferenceError |
|
|
|
Reflect オブジェクト ( |
|
|
|
RegExp |
|
|
|
|
|
|
|
Set |
|
|
|
|
|
|
|
SharedArrayBuffer |
|
|
|
String |
|
|
|
|
|
|
|
SuppressedError |
|
|
|
Symbol |
|
|
|
SyntaxError |
|
|
無条件に |
|
|
|
すべての typed Array |
|
|
|
|
TypeError |
|
|
|
Uint8Array |
|
|
|
Uint8ClampedArray |
|
|
|
Uint16Array |
|
|
|
Uint32Array |
|
|
|
URIError |
|
|
|
WeakMap |
|
|
|
WeakRef |
|
|
|
WeakSet |
|
|
Iterator.from によって返されるラップ済みイテレータオブジェクトのプロトタイプ ( |
仕様型は、ECMAScript言語構文および
Enumsは、仕様内部の値であり、ECMAScriptコードから直接観測できません。Enumsは
List型は、new式、関数呼び出し、および単純な順序付き値リストが必要な他のアルゴリズムにおけるargument lists(
アルゴリズムが順序を指定せずにListの要素を反復する場合、使用される順序はList内の要素の順序です。
この仕様内では、表記上の便宜のため、新しいList値を表現するためにliteral syntaxを使用できます。たとえば、« 1, 2 »は、それぞれ特定の値に初期化された2つの要素を持つList値を定義します。新しい空のListは« »として表現できます。
この仕様では、“A, B, ...のlist-concatenation”(各argumentが空であってもよいListである場合)という句は、各argumentの要素(順序どおり)の連結(順序どおり)を要素とする新しいList値を表します。
StringsのListに適用される場合、“lexicographic code unit orderに従ってソートされる”という句は、より短い文字列の長さまで各コード単位の数値でソートし、すべてが等しい場合はより短い文字列をより長い文字列の前にソートすることを意味します。これは抽象操作
Record型は、この仕様のアルゴリズム内のデータ集約を記述するために使用されます。Record型値は、1つ以上の名前付きフィールドで構成されます。各フィールドの値は
この仕様内では、表記上の便宜のため、Record値を表現するためにobject literal-like syntaxを使用できます。たとえば、{ [[Field1]]: 42, [[Field2]]:
仕様テキストおよびアルゴリズムでは、Record値の特定のフィールドを参照するためにdot notationを使用できます。たとえば、Rが前段落に示されたrecordである場合、R.[[Field2]]は“Rの[[Field2]]という名前のフィールド”を表す省略表現です。
一般的に使用されるRecordフィールドの組み合わせに対するSchemaには名前が付けられる場合があり、その名前は、記述されている特定の種類の集約を識別するためにliteral Record値の接頭辞として使用できます。例:PropertyDescriptor { [[Value]]: 42, [[Writable]]:
Set型は、
Relation型は、Sets上の制約を説明するために使用されます。Relation型の値は、その値域からの値の順序対のSetです。たとえば、
strict partial orderは、以下を満たすRelation値Rです。
Rのdomain内のすべてのa、b、およびcについて:
上記の2つの性質は、それぞれirreflexivityおよびtransitivityと呼ばれます。
strict total orderは、以下を満たすRelation値Rです。
Rのdomain内のすべてのa、b、およびcについて:
上記の3つの性質は、それぞれtotality、irreflexivity、およびtransitivityと呼ばれます。
Completion Record仕様型は、値の実行時伝播および、制御の非局所的移動を行う文(break、continue、returnおよびthrow)の振る舞いなどの制御フローを説明するために使用されます。
Completion Recordsは、
| フィールド名 | 値 | 意味 |
|---|---|---|
| [[Type]] |
|
発生したcompletionの種類。 |
| [[Value]] |
|
生成された値。 |
| [[Target]] |
Stringまたは |
directed control transfersのtarget label。 |
以下の省略用語は、Completion Recordsを参照するために使用されることがあります。
この仕様で定義されるcallable objectsは、normal completionまたはthrow completionのみを返します。他の種類のCompletion Recordを返すことは編集上の誤りと見なされます。
The abstract operation NormalCompletion takes argument value (any value except a
The abstract operation ThrowCompletion takes argument value (an ECMAScript language value) and returns a
The abstract operation ReturnCompletion takes argument value (an ECMAScript language value) and returns a
The abstract operation UpdateEmpty takes arguments completionRecord (a
Reference Record型は、delete、typeof、代入演算子、superキーワード、およびその他の言語機能のような演算子の振る舞いを説明するために使用されます。たとえば、代入の左辺オペランドはReference Recordを生成することが期待されます。
Reference Recordは、解決済みの名前または(まだ解決されていない可能性のある)プロパティ束縛です。そのフィールドは
| フィールド名 | 値 | 意味 |
|---|---|---|
| [[Base]] | 束縛を保持する値または |
|
| [[ReferencedName]] | 束縛の名前。[[Base]]値が |
|
| [[Strict]] | Boolean | |
| [[ThisValue]] | superキーワードを使用して表現されたプロパティ束縛を表します。これはSuper Reference Recordと呼ばれ、その[[Base]]値は決して |
以下の抽象操作は、この仕様においてReference Recordsを操作するために使用されます:
The abstract operation IsPropertyReference takes argument refRecord (a
The abstract operation IsUnresolvableReference takes argument refRecord (a
The abstract operation IsSuperReference takes argument refRecord (a
The abstract operation IsPrivateReference takes argument refRecord (a
The abstract operation GetValue takes argument refRecord (a
ステップ
The abstract operation PutValue takes arguments refRecord (a
ステップ
The abstract operation GetThisValue takes argument refRecord (a
The abstract operation InitializeReferencedBinding takes arguments refRecord (a
The abstract operation MakePrivateReference takes arguments baseValue (an ECMAScript language value) and privateIdentifier (a String) and returns a
Property Descriptor型は、Objectプロパティ属性の操作および具象化を説明するために使用されます。Property Descriptorは0個以上のフィールドを持つ
Property Descriptor値は、特定のフィールドの存在または使用に基づいて、data Property Descriptorsおよびaccessor Property Descriptorsにさらに分類される場合があります。data Property Descriptorは、[[Value]]または[[Writable]]という名前のフィールドのいずれかを含むものです。accessor Property Descriptorは、[[Get]]または[[Set]]という名前のフィールドのいずれかを含むものです。任意のProperty Descriptorは、[[Enumerable]]および[[Configurable]]という名前のフィールドを持つことができます。Property Descriptor値はdata Property Descriptorかつaccessor Property Descriptorの両方であってはなりません。ただし、どちらでもない場合があります(その場合、それはgeneric Property Descriptorです)。fully populated Property Descriptorは、accessor Property Descriptorまたはdata Property Descriptorのいずれかであり、
以下の抽象操作は、この仕様においてProperty Descriptor値を操作するために使用されます:
The abstract operation IsAccessorDescriptor takes argument propertyDesc (a
The abstract operation IsDataDescriptor takes argument propertyDesc (a
The abstract operation IsGenericDescriptor takes argument propertyDesc (a
The abstract operation FromPropertyDescriptor takes argument propertyDesc (a
The abstract operation ToPropertyDescriptor takes argument obj (an ECMAScript language value) and returns either a
The abstract operation CompletePropertyDescriptor takes argument propertyDesc (a
Abstract Closure仕様型は、値の集合とともにアルゴリズムステップを参照するために使用されます。Abstract Closuresはメタ値であり、closure(arg1, arg2)のような関数適用形式を使用して呼び出されます。抽象操作と同様に、呼び出しはAbstract Closureによって記述されたアルゴリズムステップを実行します。
Abstract Closureを作成するアルゴリズムステップでは、値は動詞“capture”の後にaliasesのリストを続けることで捕捉されます。Abstract Closureが作成されると、その時点で各aliasに関連付けられている値を捕捉します。Abstract Closureが呼び出されたときに実行されるアルゴリズムを指定するステップでは、各捕捉された値は、その値を捕捉するために使用されたaliasによって参照されます。
Abstract Closureが
Abstract Closuresは、他のアルゴリズムの一部としてインラインで作成されます。以下の例に示します。
Data Block仕様型は、byte-sized(8 bit)の数値の、別個で可変な列を記述するために使用されます。byte valueは、0から255までの包含区間内の整数です。Data Block値は、各byteが初期値0を持つ固定数のbytesで作成されます。
この仕様内では、表記上の便宜のため、Data Block値の個々のbytesへアクセスするためにarray-like syntaxを使用できます。この表記は、Data Block値を0-basedの
複数の
Shared Data Blocksの意味論は、
以下の抽象操作は、この仕様においてData Block値を操作するために使用されます:
The abstract operation CreateByteDataBlock takes argument size (a non-negative
The abstract operation CreateSharedByteDataBlock takes argument size (a non-negative
The abstract operation CopyDataBlockBytes takes arguments toBlock (a
PrivateElement型は、private class fields、methods、およびaccessorsの仕様で使用される
PrivateElement型の値は、
| フィールド名 | それが存在する[[Kind]]フィールドの値 | 値 | 意味 |
|---|---|---|---|
| [[Key]] | All |
|
field、method、またはaccessorの名前。 |
| [[Kind]] | All |
|
elementの種類。 |
| [[Value]] |
|
|
fieldの値。 |
| [[Get]] |
|
|
private accessorのgetter。 |
| [[Set]] |
|
|
private accessorのsetter。 |
ClassFieldDefinition型は、class fieldsの仕様で使用される
ClassFieldDefinition型の値は、
| フィールド名 | 値 | 意味 |
|---|---|---|
| [[Name]] |
|
fieldの名前。 |
| [[Initializer]] |
ECMAScript |
fieldのinitializer(存在する場合)。 |
Private Name仕様型は、private class element(field、method、またはaccessor)のキーを表す、グローバルに一意な値(それ以外は区別できない場合でも、他のいかなるPrivate Nameとも異なるもの)を記述するために使用されます。各Private Nameは、不変の[[Description]] internal slotを持ち、これはStringです。Private Nameは
ClassStaticBlockDefinition Recordは、class static initialization blockの実行可能コードをカプセル化するために使用される
ClassStaticBlockDefinition Recordsは、
| フィールド名 | 値 | 意味 |
|---|---|---|
| [[BodyFunction]] |
ECMAScript |
classのstatic initialization中に呼び出される |