이 연산들은 ECMAScript 언어의 일부가 아니며; ECMAScript 언어의 의미론을 명세하기 쉽게 하기 위해 여기에서만 정의됩니다. 이 명세 전반에 걸쳐 보다 특수화된 다른 추상 연산들이 정의됩니다.
7.1 타입 변환(Type Conversion)
ECMAScript 언어는 필요에 따라 자동으로 암시적 타입 변환을 수행합니다. 특정 구성의 의미론을 명확히 하기 위해 일련의 변환 추상 연산을 정의하는 것이 유용합니다. 변환 추상 연산은 다형적이며; 어떤 ECMAScript 언어 타입의 값이든 받을 수 있습니다. 그러나 다른 명세 타입은 이러한 연산과 함께 사용되지 않습니다.
BigInt 타입은 ECMAScript 언어에서 암시적 변환이 없습니다; 프로그래머는 다른 타입에서 값을 변환하기 위해 반드시 BigInt를 명시적으로 호출해야 합니다.
7.1.1 ToPrimitive ( input [ , preferredType ] )
The abstract operation ToPrimitive takes argument input (ECMAScript 언어 값) and optional argument preferredType (string 또는 number) and returns ECMAScript 언어 값을 담는 normal completion 또는 throw completion. input 인수를 비-Object 타입으로 변환합니다. 객체가 둘 이상의 원시 타입으로 변환 가능하다면 선택적 힌트 preferredType을 사용하여 그 타입을 우선할 수 있습니다. It performs the following steps when called:
ToPrimitive가 힌트 없이 호출되면 일반적으로 힌트가 number인 것처럼 동작합니다. 그러나 객체는 %Symbol.toPrimitive% 메서드를 정의하여 이 동작을 재정의할 수 있습니다. 이 명세에 정의된 객체 중 Date( 21.4.4.45 참조 )와 Symbol 객체( 20.4.3.5 참조 )만이 기본 ToPrimitive 동작을 재정의합니다. 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:
argument가 Boolean이면 argument를 반환한다.
argument가 undefined, null, +0𝔽, -0𝔽, NaN, 0ℤ, 또는 빈 String 중 하나이면 false를 반환한다.
argument가 Object이고 [[IsHTMLDDA]] 내부 슬롯을 갖고 있으면 false를 반환한다.
true를 반환한다.
7.1.3 ToNumeric ( value )
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 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:
int32bit ≥ 231이면 𝔽(int32bit - 232)을, 아니면 𝔽(int32bit)을 반환한다.
Note
위 정의에 따른 ToInt32의 성질:
ToInt32 추상 연산은 멱등성: 자신의 결과에 다시 적용해도 값은 변하지 않습니다.
모든 x에 대해 ToInt32(ToUint32(x))는 ToInt32(x)와 동일한 값입니다. (이 후속 성질을 보존하기 위해 +∞𝔽와 -∞𝔽이 +0𝔽으로 매핑됩니다.)
ToInt32는 -0𝔽을 +0𝔽으로 매핑합니다.
7.1.7 ToUint32 ( argument )
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:
모든 x에 대해 ToUint32(ToInt32(x))는 ToUint32(x)와 동일합니다. (+∞𝔽, -∞𝔽이 +0𝔽으로 매핑되는 이유.)
ToUint32는 -0𝔽을 +0𝔽으로 매핑합니다.
7.1.8 ToInt16 ( argument )
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:
int16bit ≥ 215이면 𝔽(int16bit - 216)을, 아니면 𝔽(int16bit)을 반환한다.
7.1.9 ToUint16 ( argument )
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:
4 단계에서 216을 232 대신 사용하는 점이 ToUint32와 ToUint16의 유일한 차이입니다.
ToUint16은 -0𝔽을 +0𝔽으로 매핑합니다.
7.1.10 ToInt8 ( argument )
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:
int8bit ≥ 27이면 𝔽(int8bit - 28)을, 아니면 𝔽(int8bit)을 반환한다.
7.1.11 ToUint8 ( argument )
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 값 중 하나로 클램프(clamp)하고 반올림합니다. It performs the following steps when called:
대부분 다른 ECMAScript 정수 변환 연산과 달리 ToUint8Clamp는 비정수 값을 절단(truncate)하지 않고 반올림합니다. 또한 “round half up”을 사용하는 Math.round와 달리 “round half to even” 절충 규칙을 사용합니다.
7.1.13 ToBigInt ( argument )
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 ToBigInt64 takes argument argument (ECMAScript 언어 값) and returns BigInt를 담는 normal completion 또는 throw completion. argument를 ℤ(-263)부터 ℤ(263 - 1)까지(포함) 264개의 BigInt 값 중 하나로 변환합니다. It performs the following steps when called:
int64bit ≥ 263이면 ℤ(int64bit - 264)을, 아니면 ℤ(int64bit)을 반환한다.
7.1.16 ToBigUint64 ( argument )
The abstract operation ToBigUint64 takes argument argument (ECMAScript 언어 값) and returns BigInt를 담는 normal completion 또는 throw completion. argument를 0ℤ에서 ℤ(264 - 1)까지(포함) 264개의 BigInt 값 중 하나로 변환합니다. 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로 클램프(clamp) 및 절단(truncate)합니다. 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:
canonical numeric string은 CanonicalNumericIndexString 추상 연산이 undefined를 반환하지 않는 모든 String입니다.
7.1.22 ToIndex ( value )
The abstract operation ToIndex takes argument value (ECMAScript 언어 값) and returns 음이 아닌 정수를 담는 normal completion 또는 throw completion. value를 정수로 변환하고, 그 정수가 음이 아니며 정수 인덱스에 대응되면 그 정수를 반환합니다. 그렇지 않으면 예외를 던집니다. It performs the following steps when called:
integer가 0에서 253 - 1 (포함) 사이에 없으면 RangeError 예외를 던진다.
integer를 반환한다.
7.2 테스트 및 비교 연산(Testing and Comparison Operations)
7.2.1 RequireObjectCoercible ( argument )
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 IsStringWellFormedUnicode takes argument string (String) and returns Boolean. 6.1.4에 설명된 대로 string을 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. 두 인수가 같은 타입인지 판정합니다. 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. 두 인수가 같은 값인지 판정합니다. 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. 두 인수가 같은 값인지 ( +0𝔽와 -0𝔽의 차이를 무시하고 ) 판정합니다. It performs the following steps when called:
SameValueZero는 +0𝔽와 -0𝔽을 동일하게 취급한다는 점만 SameValue와 다릅니다.
7.2.11 SameValueNonNumber ( x, y )
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, 또는 (적어도 한 피연산자가 NaN임을 나타내는) undefined를 반환합니다. LeftFirst 플래그는 x, y에 잠재적으로 부작용 있는 연산의 순서를 제어합니다. 이는 ECMAScript가 표현식을 좌→우로 평가하도록 규정하기 때문에 필요합니다. LeftFirst가 true이면 x 매개변수는 y 매개변수 표현식의 왼쪽에 오는 표현식에 해당합니다. false이면 반대이며 연산은 x 이전에 y에 수행되어야 합니다. It performs the following steps when called:
3 단계는 덧셈 연산자 +를 처리하는 알고리즘(13.15.3)의 1.c 단계와 논리 OR 대신 논리 AND를 사용하는 점에서 다릅니다.
Note 2
String 비교는 UTF-16 코드 유닛 값 시퀀스에 대한 단순한 사전식(lexicographic) 순서를 사용합니다. Unicode 명세에서 정의한 더 복잡하고 의미론 지향적인 문자/문자열 동등성이나 정렬 순서를 사용하려 하지 않습니다. 따라서 Unicode 표준에 따라 정규적으로 동등하지만 정규화 형태가 다른 String 값은 불일치로 판정될 수 있습니다. 또한 surrogate pair를 포함한 String의 경우 코드 유닛 기반 사전식 순서는 코드 포인트 기반 순서와 다를 수 있습니다.
The abstract operation IsStrictlyEqual takes arguments x (ECMAScript 언어 값) and y (ECMAScript 언어 값) and returns Boolean. === 연산자의 의미론을 제공합니다. It performs the following steps when called:
The abstract operation MakeBasicObject takes argument internalSlotsList (내부 슬롯 이름들의 List) and returns Object. 알고리즘적으로 생성되는 모든 ECMAScript 객체(ordinary 및 exotic 포함)의 근원입니다. 모든 객체 생성에서 사용되는 공통 단계를 분리하고 객체 생성을 중앙화합니다. It performs the following steps when called:
obj의 essential 내부 메소드를 10.1에 지정된 기본 ordinary object 정의로 설정한다.
단언: 호출자가 obj의 [[GetPrototypeOf]]와 [[SetPrototypeOf]] essential 내부 메소드를 모두 재정의하지 않을 경우 internalSlotsList는 [[Prototype]]을 포함한다.
단언: 호출자가 obj의 [[SetPrototypeOf]], [[IsExtensible]], [[PreventExtensions]] essential 내부 메소드를 모두 재정의하지 않을 경우 internalSlotsList는 [[Extensible]]을 포함한다.
internalSlotsList가 [[Extensible]]을 포함하면 obj.[[Extensible]]를 true로 둔다.
obj를 반환한다.
Note
이 명세 내에서 exotic 객체는 ArrayCreate, BoundFunctionCreate 같은 추상 연산에서 먼저 MakeBasicObject를 호출하여 기본 객체를 얻고 그 후 그 객체의 일부 또는 모든 내부 메소드를 재정의하여 생성됩니다. exotic 객체 생성을 캡슐화하기 위해 객체의 essential 내부 메소드는 그러한 연산 외부에서는 수정되지 않습니다.
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:
success를 ? O.[[Set]](P, V, O)로 둔다.
success가 false이고 Throw가 true이면 TypeError 예외를 던진다.
unused를 반환한다.
7.3.5 CreateDataProperty ( O, P, V )
The abstract operation CreateDataProperty takes arguments O (Object), P (프로퍼티 키), and V (ECMAScript 언어 값) and returns Boolean을 담는 normal completion 또는 throw completion. 객체의 새로운 own 프로퍼티를 생성하는 데 사용됩니다. 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. 객체의 새로운 own 프로퍼티를 생성하는 데 사용되며, 요청된 프로퍼티 갱신이 수행될 수 없으면 TypeError 예외를 던집니다. It performs the following steps when called:
이 추상 연산은 ECMAScript 대입 연산자가 생성하는 프로퍼티와 동일 기본 속성을 가지는 프로퍼티를 생성합니다. 일반적으로 프로퍼티는 미존재 상태입니다. 존재하고 비구성이거나 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. ordinary 객체의 새 비열거 own 프로퍼티를 생성하는 데 사용됩니다. It performs the following steps when called:
이 추상 연산은 ECMAScript 대입 연산자가 생성하는 프로퍼티와 동일 기본 속성을 가지되 열거 가능하지 않은 프로퍼티를 생성합니다. 일반적으로 프로퍼티는 미존재 상태입니다. 존재하는 경우 DefinePropertyOrThrow는 정상적으로 완료됨이 보장됩니다.
7.3.8 DefinePropertyOrThrow ( O, P, desc )
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. 객체의 특정 own 프로퍼티를 제거하는 데 사용됩니다. 프로퍼티가 비구성이면 예외를 던집니다. It performs the following steps when called:
The abstract operation HasProperty takes arguments O (Object) and P (프로퍼티 키) and returns Boolean을 담는 normal completion 또는 throw completion. 객체가 지정된 프로퍼티 키를 가진 프로퍼티(own 또는 상속)를 갖는지 판정합니다. 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. 객체가 지정된 프로퍼티 키를 가진 own 프로퍼티를 갖는지 판정합니다. It performs the following steps when called:
The abstract operation Construct takes argument F (생성자) and optional arguments argumentsList (ECMAScript 언어 값들의 List) and newTarget (생성자) and returns Object를 담는 normal completion 또는 throw completion. 함수 객체의 [[Construct]] 내부 메소드를 호출하는 데 사용됩니다. argumentsList, newTarget은 내부 메소드에 전달될 해당 인자 값입니다. argumentsList가 없으면 새 빈 List가, newTarget이 없으면 F가 사용됩니다. It performs the following steps when called:
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. 객체의 own 프로퍼티 집합을 고정(fix)하는 데 사용됩니다. It performs the following steps when called:
status를 ? O.[[PreventExtensions]]()로 둔다.
status가 false이면 false를 반환한다.
keys를 ? O.[[OwnPropertyKeys]]()로 둔다.
level이 sealed이면,
keys의 각 요소 k에 대해
? DefinePropertyOrThrow(O, k, PropertyDescriptor { [[Configurable]]: false })를 수행한다.
The abstract operation TestIntegrityLevel takes arguments O (Object) and level (sealed 또는 frozen) and returns Boolean을 담는 normal completion 또는 throw completion. 객체의 own 프로퍼티 집합이 고정되어 있는지 판정하는 데 사용됩니다. 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:
The abstract operation CreateListFromArrayLike takes argument obj (ECMAScript 언어 값) and optional argument validElementTypes (all 또는 property-key) and returns ECMAScript 언어 값들의 List를 담는 normal completion 또는 throw completion. obj의 인덱스된 프로퍼티가 제공하는 요소로 이루어진 List 값을 생성하는 데 사용됩니다. validElementTypes는 요소로 허용되는 값 타입을 지정합니다. It performs the following steps when called:
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 (생성자) and returns 생성자를 담는 normal completion 또는 throw completion. O로부터 파생된 새 객체를 생성할 때 사용해야 하는 생성자를 가져오는 데 사용됩니다. defaultConstructor는 O부터 시작하여 %Symbol.species% 프로퍼티 생성자를 찾을 수 없을 때 사용할 생성자입니다. 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:
여기에 전달되는 target은 항상 새로 생성된 객체이며, 오류 발생 시 직접 접근할 수 없습니다.
7.3.26 PrivateElementFind ( O, P )
The abstract operation PrivateElementFind takes arguments O (Object) and P (Private Name) and returns PrivateElement 또는 empty. It performs the following steps when called:
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:
private 메서드와 접근자의 값은 인스턴스 간에 공유됩니다. 이 연산은 메서드나 접근자의 새 복사본을 만들지 않습니다.
7.3.29 HostEnsureCanAddPrivateElement ( O )
The host-defined abstract operation HostEnsureCanAddPrivateElement takes argument O (Object) and returns unused을 담는 normal completion 또는 throw completion. 호스트 환경이 특정 호스트 정의 exotic 객체에 private element 추가를 방지할 수 있도록 합니다.
HostEnsureCanAddPrivateElement 구현은 다음 요구사항을 따라야 합니다:
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:
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 IteratorStep takes argument iteratorRecord (Iterator Record) and returns Object 또는 done을 담는 normal completion 또는 throw completion. iteratorRecord.[[Iterator]]에서 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.[[Iterator]]에서 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. async 이터레이터가 완료 상태에 도달했을 때 일반적으로 수행할 동작을 실행하도록 알리는 데 사용됩니다. It performs the following steps when called:
innerResult.[[Value]]가 Object가 아니면 TypeError 예외를 던진다.
? completion을 반환한다.
7.4.14 CreateIteratorResultObject ( value, done )
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. [[NextMethod]]가 list의 연속 요소를 반환하는 Iterator Record를 생성합니다. It performs the following steps when called:
closure를 매개변수 없고 list를 캡처하며 호출 시 다음 단계를 수행하는 새 Abstract Closure로 둔다: