이 연산들은 ECMAScript 언어의 일부가 아니다. 이들은 오직 ECMAScript
언어의 의미론 명세를 돕기 위해 여기서 정의된다. 더 특수화된 다른 추상
연산들은 이 명세 전반에 걸쳐 정의된다.
7.1 타입 변환
ECMAScript 언어는 필요에 따라 암묵적으로 자동 타입 변환을 수행한다.
특정 구성요소의 의미론을 명확히 하기 위해 변환 추상 연산들의 집합을
정의하는 것이 유용하다. 변환 추상 연산은 다형적이다. 즉, 어떤
ECMAScript 언어 타입의 값도 받아들일 수 있다. 그러나 다른 명세 타입은
이 연산들과 함께 사용되지 않는다.
BigInt 타입은 ECMAScript 언어에서 암묵적 변환을 가지지 않는다.
프로그래머는 다른 타입의 값을 변환하기 위해 BigInt를 명시적으로 호출해야
한다.
7.1.1 ToPrimitive ( input [ , preferredType ] )
The abstract operation ToPrimitive takes argument input (an ECMAScript language value) and optional argument preferredType (string or number) and returns either a normal completion containing an ECMAScript language value or a throw completion. 이것은 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 ( obj, hint )
The abstract operation OrdinaryToPrimitive takes arguments obj (an Object) and hint (string or number) and returns either a normal completion containing an ECMAScript language value or a throw completion. It performs the following steps when called:
The abstract operation ToBoolean takes argument argument (an ECMAScript language value) and returns a 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 (an ECMAScript language value) and returns either a normal completion containing either a Number or a BigInt, or a throw completion. 이것은 value를 Number 또는 BigInt로 변환해 반환한다. It performs the following steps when called:
The abstract operation ToNumber takes argument argument (an ECMAScript language value) and returns either a normal completion containing a Number or a throw completion. 이것은 argument를 Number 타입의 값으로 변환한다. It performs the following steps when called:
The abstract operation RoundMVResult takes argument n (a mathematical value) and returns a Number. 이것은 n을 구현 정의 방식으로 Number로 변환한다.
이 추상 연산의 목적상, 어떤 자릿수는 그것이 0이 아니거나,
또는 그 왼쪽에 0이 아닌 자릿수가 있고 오른쪽에도 0이 아닌
자릿수가 있으면 유효하다. 또한 이 추상 연산의 목적상,
수학적 값의 한 표현이 “나타내는 수학적 값”은 수학적 값의
“십진 표현”의 역이다. It performs the following steps when called:
The abstract operation ToIntegerOrInfinity takes argument argument (an ECMAScript language value) and returns either a normal completion containing either an integer, +∞, or -∞, or a throw completion. 이것은 argument를 소수 부분이 절단된 Number 값을 나타내는
정수로 변환하거나, 그 Number 값이 무한이면 +∞ 또는 -∞로 변환한다. It performs the following steps when called:
The abstract operation ToFixedSizeInteger takes arguments int (an integer, +∞, or -∞), signed (unsigned or signed), and bitWidth (a positive integer) and returns an integer. 이는 int를 0부터 2bitWidth - 1까지의 포함 구간에 있는 2bitWidth개의 정수 중 하나로(unsigned인 경우), 또는 -2bitWidth - 1부터 2bitWidth - 1 - 1까지의 포함 구간에 있는 정수 중 하나로(signed인 경우) 매핑한다. It performs the following steps when called:
ToFixedSizeInteger는 멱등적이다. 즉, 임의의 ECMAScript 언어 값 x에 대해 ToFixedSizeInteger(ToFixedSizeInteger(x, signed, bitWidth), signed, bitWidth)는 ToFixedSizeInteger(x, signed, bitWidth)와 같다. 실제로 +∞와 -∞는 0으로 매핑되므로, 이 불변성은 signed의 반전에서도 유지된다(예: ToFixedSizeInteger(ToFixedSizeInteger(x, signed, 32), unsigned, 32)는 ToFixedSizeInteger(x, unsigned, 32)와 같다).
7.1.7 ToInt32 ( argument )
The abstract operation ToInt32 takes argument argument (ECMAScript 언어 값) and returns 정수 Number를 포함하는 정상 완료 또는 throw 완료. 이는 argument를 𝔽(-231)부터 𝔽(231 - 1)까지의 포함 구간에 있는 232개의 정수 Number 값 중 하나로 변환하며, -0𝔽는 제외한다. It performs the following steps when called:
The abstract operation ToUint32 takes argument argument (ECMAScript 언어 값) and returns 정수 Number를 포함하는 정상 완료 또는 throw 완료. 이는 argument를 +0𝔽부터 𝔽(232 - 1)까지의 포함 구간에 있는 232개의 정수 Number 값 중 하나로 변환한다. It performs the following steps when called:
The abstract operation ToInt16 takes argument argument (ECMAScript 언어 값) and returns 정수 Number를 포함하는 정상 완료 또는 throw 완료. 이는 argument를 𝔽(-215)부터 𝔽(215 - 1)까지의 포함 구간에 있는 216개의 정수 Number 값 중 하나로 변환하며, -0𝔽는 제외한다. It performs the following steps when called:
The abstract operation ToUint16 takes argument argument (ECMAScript 언어 값) and returns 정수 Number를 포함하는 정상 완료 또는 throw 완료. 이는 argument를 +0𝔽부터 𝔽(216 - 1)까지의 포함 구간에 있는 216개의 정수 Number 값 중 하나로 변환한다. It performs the following steps when called:
The abstract operation ToInt8 takes argument argument (ECMAScript 언어 값) and returns 정수 Number를 포함하는 정상 완료 또는 throw 완료. 이는 argument를 -128𝔽부터 127𝔽까지의 포함 구간에 있는 28개의 정수 Number 값 중 하나로 변환하며, -0𝔽는 제외한다. It performs the following steps when called:
The abstract operation ToUint8 takes argument argument (ECMAScript 언어 값) and returns 정수 Number를 포함하는 정상 완료 또는 throw 완료. 이는 argument를 +0𝔽부터 255𝔽까지의 포함 구간에 있는 28개의 정수 Number 값 중 하나로 변환한다. It performs the following steps when called:
The abstract operation ToUint8Clamp takes argument argument (ECMAScript 언어 값) and returns 정수 Number를 포함하는 정상 완료 또는 throw 완료. 이는 argument를 0부터 255까지의 포함 구간에 있는 28개의 정수 Number 값 중 하나로 클램프하고 반올림한다. It performs the following steps when called:
대부분의 다른 ECMAScript 정수 변환 연산과 달리, ToUint8Clamp는 비정수 값을 자르지 않고 반올림한다. 또한 “절반은 짝수로 반올림” 동률 처리 방식을 사용하는데, 이는 Math.round의 “절반 올림” 동률 처리 방식과 다르다.
7.1.14 ToBigInt ( argument )
The abstract operation ToBigInt takes argument argument (ECMAScript 언어 값) and returns BigInt를 포함하는 정상 완료 또는 throw 완료. 이는 argument를 BigInt 값으로 변환하거나, Number에서의 암시적 변환이 필요한 경우 던진다. It performs the following steps when called:
The abstract operation ToBigInt64 takes argument argument (ECMAScript 언어 값) and returns BigInt를 포함하는 정상 완료 또는 throw 완료. 이는 argument를 ℤ(-263)부터 ℤ(263 - 1)까지의 포함 구간에 있는 264개의 BigInt 값 중 하나로 변환한다. It performs the following steps when called:
The abstract operation ToBigUint64 takes argument argument (ECMAScript 언어 값) and returns BigInt를 포함하는 정상 완료 또는 throw 완료. 이는 argument를 0ℤ부터 ℤ(264 - 1)까지의 포함 구간에 있는 264개의 BigInt 값 중 하나로 변환한다. It performs the following steps when called:
The abstract operation ToString takes argument argument (ECMAScript 언어 값) and returns String을 포함하는 정상 완료 또는 throw 완료. 이는 argument를 String 타입의 값으로 변환한다. It performs the following steps when called:
The abstract operation ToObject takes argument argument (ECMAScript 언어 값) and returns Object를 포함하는 정상 완료 또는 throw 완료. 이는 argument를 Object 타입의 값으로 변환한다. It performs the following steps when called:
argument가 undefined 또는 null이면, TypeError 예외를 던진다.
argument가 Boolean이면, [[BooleanData]] 내부 슬롯이 argument로 설정된 새로운 Boolean 객체를 반환한다. Boolean 객체에 대한 설명은 20.3를 보라.
argument가 Number이면, [[NumberData]] 내부 슬롯이 argument로 설정된 새로운 Number 객체를 반환한다. Number 객체에 대한 설명은 21.1를 보라.
argument가 String이면, [[StringData]] 내부 슬롯이 argument로 설정된 새로운 String 객체를 반환한다. String 객체에 대한 설명은 22.1를 보라.
argument가 Symbol이면, [[SymbolData]] 내부 슬롯이 argument로 설정된 새로운 Symbol 객체를 반환한다. Symbol 객체에 대한 설명은 20.4를 보라.
argument가 BigInt이면, [[BigIntData]] 내부 슬롯이 argument로 설정된 새로운 BigInt 객체를 반환한다. BigInt 객체에 대한 설명은 21.2를 보라.
The abstract operation ToPropertyKey takes argument argument (ECMAScript 언어 값) and returns 속성 키를 포함하는 정상 완료 또는 throw 완료. 이는 argument를 속성 키로 사용할 수 있는 값으로 변환한다. It performs the following steps when called:
The abstract operation ToLength takes argument argument (ECMAScript 언어 값) and returns 음이 아닌 정수 Number를 포함하는 정상 완료 또는 throw 완료. 이는 argument를 배열 유사 객체의 길이로 사용하기에 적합한 음이 아닌 정수 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:
표준 숫자 문자열은 CanonicalNumericIndexString 추상 연산이 undefined를 반환하지 않는 모든 String이다.
7.1.23 ToIndex ( value )
The abstract operation ToIndex takes argument value (an ECMAScript language value) and returns either a normal completion containing a non-negative integer or a throw completion. 이것은 value를 정수로 변환하고, 그 정수가 음이 아니며 integer
index에 대응하면 그 정수를 반환한다. 그렇지 않으면 예외를 던진다. It performs the following steps when called:
integer가 0부터 253 - 1까지의 포함 구간 안에 있지 않으면, RangeError 예외를 던진다.
integer를 반환한다.
7.2 테스트 및 비교 연산
7.2.1 RequireObjectCoercible ( argument )
The abstract operation RequireObjectCoercible takes argument argument (an ECMAScript language value) and returns either a normal completion containing unused or a throw completion. 이것은 argument가 ToObject를 사용해 Object로 변환될 수 없는
값이면 오류를 던진다. It performs the following steps when called:
argument가 undefined 또는 null이면, TypeError 예외를 던진다.
unused를 반환한다.
7.2.2 IsArray ( argument )
The abstract operation IsArray takes argument argument (an ECMAScript language value) and returns either a normal completion containing a Boolean or a throw completion. It performs the following steps when called:
The abstract operation IsCallable takes argument argument (an ECMAScript language value) and returns a 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 (an ECMAScript language value) and returns a Boolean. 이것은 argument가 [[Construct]] 내부 메서드를 가진 함수 객체인지
결정한다. It performs the following steps when called:
argument가 Object가 아니면, false를 반환한다.
argument가 [[Construct]] 내부 메서드를 가지면, true를 반환한다.
false를 반환한다.
7.2.5 IsExtensible ( obj )
The abstract operation IsExtensible takes argument obj (an Object) and returns either a normal completion containing a Boolean or a throw completion. 이것은 obj에 추가 프로퍼티를 더할 수 있는지 결정하는 데
사용된다. It performs the following steps when called:
? obj.[[IsExtensible]]()를 반환한다.
7.2.6 IsRegExp ( argument )
The abstract operation IsRegExp takes argument argument (an ECMAScript language value) and returns either a normal completion containing a Boolean or a throw completion. It performs the following steps when called:
The abstract operation IsStringWellFormedUnicode takes argument string (a String) and returns a Boolean. 이것은 string을
6.1.4
에 설명된 대로 UTF-16으로 인코딩된 code point 시퀀스로 해석하고,
그것이 well formed
UTF-16 시퀀스인지 결정한다. It performs the following steps when called:
The abstract operation SameType takes arguments x (an ECMAScript language value) and y (an ECMAScript language value) and returns a 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 (an ECMAScript language value) and y (an ECMAScript language value) and returns a 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 (an ECMAScript language value) and y (an ECMAScript language value) and returns a 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 (an ECMAScript language value, but not a Number) and y (an ECMAScript language value, but not a Number) and returns a Boolean. It performs the following steps when called:
The abstract operation IsLessThan takes arguments x (an ECMAScript language value), y (an ECMAScript language value), and leftFirst (a Boolean) and returns either a normal completion containing either a Boolean or undefined, or a throw completion. x < y 비교에 대한 의미론을 제공하며, true, false 또는 undefined를 반환한다(undefined는 피연산자를 동일한 수치 타입의 비교 가능한 값으로 강제 변환할 수 없음을 나타낸다). leftFirst 플래그는 x와 y에 대해 잠재적으로 관찰 가능한 부수 효과가 있는 연산이 수행되는 순서를 제어하는 데 사용된다. ECMAScript는 표현식의 왼쪽에서 오른쪽으로의 평가를 명시하므로 이것이 필요하다. leftFirst가 true이면, x 매개변수는 y 매개변수에 대응하는 표현식의 왼쪽에 나타나는 표현식에 대응한다. leftFirst가 false이면 그 반대의 경우이며, 연산은 x보다 y에 대해 먼저 수행되어야 한다. It performs the following steps when called:
단계 3는, 덧셈
연산자 +를 처리하는 알고리즘
(13.15.3)
의 단계 1.c와
달리 논리합이 아니라 논리곱 연산을 사용한다는 점에서 다르다.
Note 2
String 비교는 UTF-16 code unit 값들의 시퀀스에 대한 단순한
사전식 순서를 사용한다. Unicode 명세에 정의된 문자 또는 문자열
동등성과 정렬 순서의 더 복잡하고 의미 지향적인 정의를 사용하려는
시도는 하지 않는다. 따라서 Unicode 표준에 따라 정준적으로 같지만
같은 정규화 형식이 아닌 String 값은 서로 같지 않은 것으로 테스트될 수
있다. 또한 surrogate pair를 포함한 String에 대해
code unit에 의한 사전식 순서가 code point에 의한
순서와 다르다는 점도 유의하라.
7.2.13 IsLooselyEqual ( x, y )
The abstract operation IsLooselyEqual takes arguments x (an ECMAScript language value) and y (an ECMAScript language value) and returns either a normal completion containing a Boolean or a throw completion. 이것은 == 연산자의 의미론을 제공한다. It performs the following steps when called:
The abstract operation IsStrictlyEqual takes arguments x (an ECMAScript language value) and y (an ECMAScript language value) and returns a Boolean. 이것은 === 연산자의 의미론을 제공한다. It performs the following steps when called:
이 알고리즘은 signed zero와 NaN을 처리하는 방식에서 SameValue
알고리즘과 다르다.
7.3 객체에 대한 연산
7.3.1 MakeBasicObject ( internalSlotsList )
The abstract operation MakeBasicObject takes argument internalSlotsList (a List of internal slot names) and returns an Object. 이것은 ordinary object와 exotic object를 포함하여 알고리즘적으로
생성되는 모든 ECMAScript 객체의 원천이다. 이것은 모든 객체 생성에
사용되는 공통 단계를 분리해내고, 객체 생성을 중앙화한다. It performs the following steps when called:
The abstract operation Get takes arguments obj (an Object) and propertyKey (a property key) and returns either a normal completion containing an ECMAScript language value or a throw completion. 이것은 객체의 특정 프로퍼티 값을 검색하는 데 사용된다. It performs the following steps when called:
? obj.[[Get]](propertyKey, obj)를 반환한다.
7.3.3 GetV ( value, propertyKey )
The abstract operation GetV takes arguments value (an ECMAScript language value) and propertyKey (a property key) and returns either a normal completion containing an ECMAScript language value or a throw completion. 이것은 ECMAScript 언어 값의 특정 프로퍼티 값을 검색하는 데
사용된다. 값이 객체가 아니면, 프로퍼티 조회는 그 값의 타입에 적합한
래퍼 객체를 사용하여 수행된다. It performs the following steps when called:
The abstract operation Set takes arguments obj (an Object), propertyKey (a property key), value (an ECMAScript language value), and throw (a Boolean) and returns either a normal completion containing unused or a throw completion. 이것은 객체의 특정 프로퍼티 값을 설정하는 데 사용된다.
value는 그 프로퍼티의 새 값이다. It performs the following steps when called:
success를 ? obj.[[Set]](propertyKey, value, obj)라고 하자.
7.3.5 CreateDataProperty ( obj, propertyKey, value )
The abstract operation CreateDataProperty takes arguments obj (an Object), propertyKey (a property key), and value (an ECMAScript language value) and returns either a normal completion containing a Boolean or a throw completion. 이것은 객체의 새로운 own 프로퍼티를 생성하는 데 사용된다. It performs the following steps when called:
이 추상 연산은 ECMAScript 언어 할당 연산자가 생성하는 프로퍼티에
사용되는 것과 동일한 기본 속성을 가진 프로퍼티를 생성한다. 일반적으로
그 프로퍼티는 아직 존재하지 않을 것이다. 만약 이미 존재하고
configurable이 아니거나 obj가 extensible하지 않다면,
[[DefineOwnProperty]]는 false를 반환할 것이다.
7.3.6 CreateDataPropertyOrThrow ( obj, propertyKey, value )
The abstract operation CreateDataPropertyOrThrow takes arguments obj (an Object), propertyKey (a property key), and value (an ECMAScript language value) and returns either a normal completion containing unused or a throw completion. 이것은 객체의 새로운 own 프로퍼티를 생성하는 데 사용된다.
요청된 프로퍼티 갱신을 수행할 수 없으면 TypeError 예외를 던진다. It performs the following steps when called:
이 추상 연산은 ECMAScript 언어 할당 연산자가 생성하는 프로퍼티에
사용되는 것과 동일한 기본 속성을 가진 프로퍼티를 생성한다. 일반적으로
그 프로퍼티는 아직 존재하지 않을 것이다. 만약 이미 존재하고
configurable이 아니거나 obj가 extensible하지 않다면,
[[DefineOwnProperty]]는 false를 반환하여 이 연산이 TypeError
예외를 던지게 한다.
7.3.7 CreateNonEnumerableDataPropertyOrThrow ( obj, propertyKey, value )
The abstract operation CreateNonEnumerableDataPropertyOrThrow takes arguments obj (an Object), propertyKey (a property key), and value (an ECMAScript language value) and returns unused. 이것은 ordinary object의 새로운 non-enumerable own 프로퍼티를
생성하는 데 사용된다. It performs the following steps when called:
Assert: obj는 ordinary하고 extensible하며 non-configurable 프로퍼티를 가지지 않는 객체이다.
이 추상 연산은 ECMAScript 언어 할당 연산자가 생성하는 프로퍼티에
사용되는 것과 동일한 기본 속성을 가지되 enumerable하지 않은 프로퍼티를
생성한다. 일반적으로 그 프로퍼티는 아직 존재하지 않을 것이다.
만약 존재하더라도, DefinePropertyOrThrow는 정상적으로 완료됨이
보장된다.
The abstract operation DefinePropertyOrThrow takes arguments obj (an Object), propertyKey (a property key), and desc (a Property Descriptor) and returns either a normal completion containing unused or a throw completion. 이것은 객체의 [[DefineOwnProperty]] 내부 메서드를, 요청된
프로퍼티 갱신을 수행할 수 없으면 TypeError 예외를 던지는 방식으로
호출하는 데 사용된다. It performs the following steps when called:
success를 ? obj.[[DefineOwnProperty]](propertyKey, desc)라고 하자.
success가 false이면, TypeError 예외를 던진다.
unused를 반환한다.
7.3.9 DeletePropertyOrThrow ( obj, propertyKey )
The abstract operation DeletePropertyOrThrow takes arguments obj (an Object) and propertyKey (a property key) and returns either a normal completion containing unused or a throw completion. 이것은 객체의 특정 own 프로퍼티를 제거하는 데 사용된다.
프로퍼티가 configurable하지 않으면 예외를 던진다. It performs the following steps when called:
success를 ? obj.[[Delete]](propertyKey)라고 하자.
success가 false이면, TypeError 예외를 던진다.
unused를 반환한다.
7.3.10 GetMethod ( value, propertyKey )
The abstract operation GetMethod takes arguments value (an ECMAScript language value) and propertyKey (a property key) and returns either a normal completion containing either a function object or undefined, or a throw completion. 이것은 ECMAScript 언어 값의 특정 프로퍼티 값을 얻는 데
사용되며, 그 프로퍼티 값은 함수일 것으로 기대된다. It performs the following steps when called:
The abstract operation HasProperty takes arguments obj (an Object) and propertyKey (a property key) and returns either a normal completion containing a Boolean or a throw completion. 이것은 객체가 지정된 property key를 가진 프로퍼티를 가지는지
결정하는 데 사용된다. 그 프로퍼티는 own일 수도 있고 상속된 것일 수도
있다. It performs the following steps when called:
? obj.[[HasProperty]](propertyKey)를 반환한다.
7.3.12 HasOwnProperty ( obj, propertyKey )
The abstract operation HasOwnProperty takes arguments obj (an Object) and propertyKey (a property key) and returns either a normal completion containing a Boolean or a throw completion. 이것은 객체가 지정된 property key를 가진 own 프로퍼티를 가지는지
결정하는 데 사용된다. It performs the following steps when called:
The abstract operation Call takes arguments func (an ECMAScript language value) and thisValue (an ECMAScript language value) and optional argument argumentsList (a List of ECMAScript language values) and returns either a normal completion containing an ECMAScript language value or a throw completion. 이것은 함수 객체의 [[Call]] 내부 메서드를 호출하는 데 사용된다.
func는 함수 객체이고, thisValue는 [[Call]]의 this 값이 되는
ECMAScript 언어 값이며, argumentsList는 내부 메서드의 대응 인수에
전달되는 값이다. argumentsList가 존재하지 않으면, 새로운 빈 List가
그 값으로 사용된다. It performs the following steps when called:
argumentsList가 존재하지 않으면, argumentsList를 새로운 빈 List로 설정한다.
The abstract operation Construct takes argument constructor (a constructor) and optional arguments argumentsList (a List of ECMAScript language values) and newTarget (a constructor) and returns either a normal completion containing an Object or a throw completion. 이것은 함수 객체의 [[Construct]] 내부 메서드를 호출하는 데
사용된다. argumentsList와 newTarget은 내부 메서드의 대응 인수로
전달될 값들이다. argumentsList가 존재하지 않으면, 새로운 빈 List가
그 값으로 사용된다. newTarget이 존재하지 않으면, constructor가
그 값으로 사용된다. It performs the following steps when called:
newTarget이 존재하지 않으면, newTarget을 constructor로 설정한다.
argumentsList가 존재하지 않으면, argumentsList를 새로운 빈 List로 설정한다.
newTarget이 존재하지 않으면, 이 연산은 new F(...argumentsList)와
동등하다.
7.3.15 SetIntegrityLevel ( obj, level )
The abstract operation SetIntegrityLevel takes arguments obj (an Object) and level (sealed or frozen) and returns either a normal completion containing a Boolean or a throw completion. 이것은 객체의 own 프로퍼티 집합을 고정하는 데 사용된다. It performs the following steps when called:
status를 ? obj.[[PreventExtensions]]()라고 하자.
status가 false이면, false를 반환한다.
keys를 ? obj.[[OwnPropertyKeys]]()라고 하자.
level이 sealed이면,
keys의 각 요소 key에 대해, 다음을 수행한다.
? DefinePropertyOrThrow(obj, key, PropertyDescriptor { [[Configurable]]: false })를 수행한다.
The abstract operation TestIntegrityLevel takes arguments obj (an Object) and level (sealed or frozen) and returns either a normal completion containing a Boolean or a throw completion. 이것은 객체의 own 프로퍼티 집합이 고정되어 있는지 결정하는 데
사용된다. It performs the following steps when called:
The abstract operation CreateArrayFromList takes argument elements (a List of ECMAScript language values) and returns an Array. 이것은 elements가 제공하는 요소들을 가진 Array를 생성하는 데
사용된다. It performs the following steps when called:
The abstract operation LengthOfArrayLike takes argument obj (an Object) and returns either a normal completion containing a non-negative integer or a throw completion. 이것은 배열 유사 객체의 "length" 프로퍼티 값을 반환한다. It performs the following steps when called:
The abstract operation CreateListFromArrayLike takes argument obj (an ECMAScript language value) and optional argument validElementTypes (all or property-key) and returns either a normal completion containing a List of ECMAScript language values or a throw completion. 이것은 obj의 인덱스된 프로퍼티들이 제공하는 요소들로 구성된
List 값을 생성하는 데 사용된다. validElementTypes는 요소로 허용되는
값의 타입들을 나타낸다. It performs the following steps when called:
validElementTypes가 존재하지 않으면, validElementTypes를 all로 설정한다.
The abstract operation Invoke takes arguments value (an ECMAScript language value) and propertyKey (a property key) and optional argument argumentsList (a List of ECMAScript language values) and returns either a normal completion containing an ECMAScript language value or a throw completion. 이것은 ECMAScript 언어 값의 메서드 프로퍼티를 호출하는 데
사용된다. value는 프로퍼티 조회 지점이자 호출의 this 값 역할을
모두 한다. argumentsList는 메서드에 전달되는 인수 값들의 목록이다.
argumentsList가 존재하지 않으면, 새로운 빈 List가 그 값으로
사용된다. It performs the following steps when called:
argumentsList가 존재하지 않으면, argumentsList를 새로운 빈 List로 설정한다.
The abstract operation OrdinaryHasInstance takes arguments constructor (an ECMAScript language value) and instance (an ECMAScript language value) and returns either a normal completion containing a Boolean or a throw completion. 이것은 instance가 constructor가 제공하는 인스턴스 객체 상속
경로를 상속하는지를 결정하는 기본 알고리즘을 구현한다. It performs the following steps when called:
The abstract operation SpeciesConstructor takes arguments obj (an Object) and defaultConstructor (a constructor) and returns either a normal completion containing a constructor or a throw completion. 이것은 obj에서 파생되는 새 객체를 생성하는 데 사용되어야 할
생성자를 검색하는 데 사용된다. defaultConstructor는 obj에서부터
시작해 생성자 %Symbol.species% 프로퍼티를 찾을 수 없을 때 사용할
생성자이다. It performs the following steps when called:
The abstract operation EnumerableOwnProperties takes arguments obj (an Object) and kind (key, value, or key+value) and returns either a normal completion containing a List of ECMAScript language values or a throw completion. It performs the following steps when called:
The abstract operation CopyDataProperties takes arguments target (an Object), source (an ECMAScript language value), and excludedItems (a List of property keys) and returns either a normal completion containing unused or a throw completion. It performs the following steps when called:
여기에 전달되는 target은 항상 새로 생성된 객체이며, 오류가 던져지는
경우 직접 접근할 수 없다.
7.3.26 PrivateElementFind ( obj, privateName )
The abstract operation PrivateElementFind takes arguments obj (an Object) and privateName (a Private Name) and returns a PrivateElement or empty. It performs the following steps when called:
7.3.27 PrivateFieldAdd ( obj, privateName, value )
The abstract operation PrivateFieldAdd takes arguments obj (an Object), privateName (a Private Name), and value (an ECMAScript language value) and returns either a normal completion containing unused or a throw completion. It performs the following steps when called:
The abstract operation PrivateMethodOrAccessorAdd takes arguments obj (an Object) and method (a PrivateElement) and returns either a normal completion containing unused or a throw completion. It performs the following steps when called:
Assert: method.[[Kind]]는 method 또는 accessor 중 하나이다.
private method와 accessor의 값은 인스턴스 간에 공유된다.
이 연산은 method나 accessor의 새 복사본을 생성하지 않는다.
7.3.29 HostEnsureCanAddPrivateElement ( obj )
The host-defined abstract operation HostEnsureCanAddPrivateElement takes argument obj (an Object) and returns either a normal completion containing unused or a throw completion. 이것은 호스트 환경이 특정 호스트 정의exotic object에 private
element를 추가하는 것을 막을 수 있게 한다.
HostEnsureCanAddPrivateElement의 구현은 다음 요구 사항을 준수해야 한다.
The abstract operation PrivateGet takes arguments obj (an Object) and privateName (a Private Name) and returns either a normal completion containing an ECMAScript language value or a throw completion. It performs the following steps when called:
The abstract operation PrivateSet takes arguments obj (an Object), privateName (a Private Name), and value (an ECMAScript language value) and returns either a normal completion containing unused or a throw completion. It performs the following steps when called:
The abstract operation DefineField takes arguments receiver (an Object) and fieldRecord (a ClassFieldDefinition Record) and returns either a normal completion containing unused or a throw completion. It performs the following steps when called:
The abstract operation InitializeInstanceElements takes arguments obj (an Object) and constructor (an ECMAScript function object or a built-in function object) and returns either a normal completion containing unused or a throw completion. It performs the following steps when called:
7.3.34 AddValueToKeyedGroup ( groups, key, value )
The abstract operation AddValueToKeyedGroup takes arguments groups (a List of Records with fields [[Key]] (an ECMAScript language value) and [[Elements]] (a List of ECMAScript language values)), key (an ECMAScript language value), and value (an ECMAScript language value) and returns unused. It performs the following steps when called:
groups의 각 Record { [[Key]], [[Elements]] } group에 대해, 다음을 수행한다.
group을 Record { [[Key]]: key, [[Elements]]: « value » }라고 하자.
group을 groups에 추가한다.
unused를 반환한다.
7.3.35 GroupBy ( items, callback, keyCoercion )
The abstract operation GroupBy takes arguments items (an ECMAScript language value), callback (an ECMAScript language value), and keyCoercion (property or collection) and returns either a normal completion containing a List of Records with fields [[Key]] (an ECMAScript language value) and [[Elements]] (a List of ECMAScript language values), or a throw completion. It performs the following steps when called:
The abstract operation GetOptionsObject takes argument options (an ECMAScript language value) and returns either a normal completion containing an Object or a throw completion. It performs the following steps when called:
7.3.37 SetterThatIgnoresPrototypeProperties ( thisValue, home, propertyKey, value )
The abstract operation SetterThatIgnoresPrototypeProperties takes arguments thisValue (an ECMAScript language value), home (an Object), propertyKey (a property key), and value (an ECMAScript language value) and returns either a normal completion containing unused or a throw completion. It performs the following steps when called:
The abstract operation GetIteratorDirect takes argument obj (an Object) and returns either a normal completion containing an Iterator Record or a throw completion. It performs the following steps when called:
iteratorRecord를 Iterator Record { [[Iterator]]: obj, [[NextMethod]]: nextMethod, [[Done]]: false }라고 하자.
iteratorRecord를 반환한다.
7.4.3 GetIteratorFromMethod ( obj, method )
The abstract operation GetIteratorFromMethod takes arguments obj (an ECMAScript language value) and method (a function object) and returns either a normal completion containing an Iterator Record or a throw completion. It performs the following steps when called:
The abstract operation GetIterator takes arguments obj (an ECMAScript language value) and kind (sync or async) and returns either a normal completion containing an Iterator Record or a throw completion. It performs the following steps when called:
The abstract operation GetIteratorFlattenable takes arguments obj (an ECMAScript language value) and primitiveHandling (iterate-string-primitives or reject-primitives) and returns either a normal completion containing an Iterator Record or a throw completion. It performs the following steps when called:
The abstract operation IteratorNext takes argument iteratorRecord (an Iterator Record) and optional argument value (an ECMAScript language value) and returns either a normal completion containing an Object or a throw completion. It performs the following steps when called:
value가 존재하지 않으면,
result를 Completion(Call(iteratorRecord.[[NextMethod]], iteratorRecord.[[Iterator]]))라고 하자.
그렇지 않으면,
result를 Completion(Call(iteratorRecord.[[NextMethod]], iteratorRecord.[[Iterator]], « value »))라고 하자.
The abstract operation IteratorComplete takes argument iteratorResult (an Object) and returns either a normal completion containing a Boolean or a throw completion. It performs the following steps when called:
The abstract operation IteratorValue takes argument iteratorResult (an Object) and returns either a normal completion containing an ECMAScript language value or a throw completion. It performs the following steps when called:
The abstract operation IteratorStep takes argument iteratorRecord (an Iterator Record) and returns either a normal completion containing either an Object or done, or a throw completion. 이것은 iteratorRecord.[[Iterator]]로부터 다음 값을 요청하기 위해
iteratorRecord.[[NextMethod]]를 호출하고, iterator가 끝에 도달했음을
나타내는 done 또는 다음 값이 사용 가능하다면 IteratorResult 객체를
반환한다. It performs the following steps when called:
The abstract operation IteratorStepValue takes argument iteratorRecord (an Iterator Record) and returns either a normal completion containing either an ECMAScript language value or done, or a throw completion. 이것은 iteratorRecord.[[Iterator]]로부터 다음 값을 요청하기 위해
iteratorRecord.[[NextMethod]]를 호출하고, iterator가 끝에 도달했음을
나타내는 done 또는 다음 값이 사용 가능하다면 IteratorResult 객체의
값을 반환한다. It performs the following steps when called:
The abstract operation IteratorClose takes arguments iteratorRecord (an Iterator Record) and completion (a Completion Record) and returns a Completion Record. 이것은 iterator에게, 완료 상태에 도달했을 때 통상 수행했을
동작을 수행해야 함을 알리는 데 사용된다. It performs the following steps when called:
The abstract operation AsyncIteratorClose takes arguments iteratorRecord (an Iterator Record) and completion (a Completion Record) and returns a Completion Record. 이것은 async iterator에게, 완료 상태에 도달했을 때 통상 수행했을
동작을 수행해야 함을 알리는 데 사용된다. It performs the following steps when called:
The abstract operation CreateIteratorResultObject takes arguments value (an ECMAScript language value) and done (a Boolean) and returns an Object that conforms to the IteratorResult interface. 이것은 IteratorResult 인터페이스에 부합하는 객체를 생성한다. It performs the following steps when called:
The abstract operation CreateListIteratorRecord takes argument list (a List of ECMAScript language values) and returns an Iterator Record. 이것은 [[NextMethod]]가 list의 연속된 요소를 반환하는 Iterator
Record를 생성한다. It performs the following steps when called:
closure를, 매개변수가 없고 list를 캡처하며 호출될 때 다음 단계를 수행하는 새로운 Abstract Closure라고 하자.