10.1 Ordinary Object Internal Methods and Internal Slots
모든 ordinary object는 [[Prototype]]이라는 internal slot을 가집니다. 이 internal slot의 value는 null 또는 object이며 inheritance를 implementing하는 데 사용됩니다. propertyKey라는 property가 ordinary objectobj에는 missing이지만 그 [[Prototype]] object에는 존재한다고 가정합니다. propertyKey가 [[Prototype]] object 위의 data property를 refer하면, obj는 get access에 대해 이를 inherit하여 propertyKey가 obj의 property인 것처럼 behave하게 합니다. propertyKey가 [[Prototype]] object 위의 writable data property를 refer하면, obj 위의 propertyKey의 set access는 obj 위에 propertyKey라는 새 data property를 create합니다. propertyKey가 [[Prototype]] object 위의 non-writable data property를 refer하면, obj 위의 propertyKey의 set access는 fail합니다. propertyKey가 [[Prototype]] object 위의 accessor property를 refer하면, accessor는 get access와 set access 모두에 대해 obj에 inherited됩니다.
모든 ordinary object는 Boolean-valued [[Extensible]] internal slot을 가지며, 이는 6.1.7.3에 specified된 extensibility-related internal method invariant를 fulfill하는 데 사용됩니다. 즉, object의 [[Extensible]] internal slot의 value가 일단 false로 set되면, 그 object에 property를 add하거나, object의 [[Prototype]] internal slot의 value를 modify하거나, 이후 [[Extensible]]의 value를 true로 change하는 것은 더 이상 possible하지 않습니다.
각 ordinary object internal method는 similarly-named abstract operation에 delegate합니다. 그러한 abstract operation이 다른 internal method에 depend하면, similarly-named abstract operation을 직접 calling하는 대신 obj 위에서 internal method가 invoked됩니다. 이러한 semantics는 ordinary object internal method가 exotic object에 applied될 때 그 overridden internal method가 invoked되도록 ensure합니다.
10.1.1[[GetPrototypeOf]] ( )
The [[GetPrototypeOf]] internal method of an ordinary objectobj takes no arguments and returns a normal completion containing either an Object or null. It performs the following steps when called:
The abstract operation OrdinaryGetPrototypeOf takes argument obj (an Object) and returns an Object or null. It performs the following steps when called:
obj.[[Prototype]]을 반환한다.
10.1.2[[SetPrototypeOf]] ( proto )
The [[SetPrototypeOf]] internal method of an ordinary objectobj takes argument proto (an Object or null) and returns a normal completion containing a Boolean. It performs the following steps when called:
The abstract operation OrdinarySetPrototypeOf takes arguments obj (an Object) and proto (an Object or null) and returns a Boolean. It performs the following steps when called:
step 7의 loop는 [[GetPrototypeOf]]와 [[SetPrototypeOf]]에 대해 ordinary object definition을 사용하는 object만 포함하는 prototype chain 안에는 cycle이 없음을 guarantee합니다.
10.1.3[[IsExtensible]] ( )
The [[IsExtensible]] internal method of an ordinary objectobj takes no arguments and returns a normal completion containing a Boolean. It performs the following steps when called:
The abstract operation OrdinaryIsExtensible takes argument obj (an Object) and returns a Boolean. It performs the following steps when called:
obj.[[Extensible]]을 반환한다.
10.1.4[[PreventExtensions]] ( )
The [[PreventExtensions]] internal method of an ordinary objectobj takes no arguments and returns a normal completion containingtrue. It performs the following steps when called:
The abstract operation OrdinaryGetOwnProperty takes arguments obj (an Object) and propertyKey (a property key) and returns a Property Descriptor or undefined. It performs the following steps when called:
obj가 key가 propertyKey인 own property를 가지지 않으면, undefined를 반환한다.
10.1.6.2 IsCompatiblePropertyDescriptor ( extensible, propertyDesc, current )
The abstract operation IsCompatiblePropertyDescriptor takes arguments extensible (a Boolean), propertyDesc (a Property Descriptor), and current (a Property Descriptor or undefined) and returns a Boolean. It performs the following steps when called:
10.1.6.3 ValidateAndApplyPropertyDescriptor ( obj, propertyKey, extensible, propertyDesc, current )
The abstract operation ValidateAndApplyPropertyDescriptor takes arguments obj (an Object or undefined), propertyKey (a property key), extensible (a Boolean), propertyDesc (a Property Descriptor), and current (a Property Descriptor or undefined) and returns a Boolean. specified extensibility와 current property current를 가진 object의 property로 propertyDesc를 invariant를 uphold하면서 apply할 수 있으면 and only if true를 반환합니다. 그러한 application이 possible하고 obj가 undefined가 아니면, propertyKey라는 name의 property에 대해 performed됩니다(필요하면 created됩니다). It performs the following steps when called:
object obj 위에 propertyKey라는 own accessor property를 create하되, 그 [[Get]], [[Set]], [[Enumerable]], [[Configurable]] attribute는 propertyDesc가 해당 field를 가지면 propertyDesc 안의 corresponding field의 value로, 그렇지 않으면 attribute의 default value로 설정한다.
그렇지 않으면,
object obj 위에 propertyKey라는 own data property를 create하되, 그 [[Value]], [[Writable]], [[Enumerable]], [[Configurable]] attribute는 propertyDesc가 해당 field를 가지면 propertyDesc 안의 corresponding field의 value로, 그렇지 않으면 attribute의 default value로 설정한다.
propertyDesc가 [[Configurable]] field를 가지면, configurable을 propertyDesc.[[Configurable]]로 둔다; 그렇지 않으면 configurable을 current.[[Configurable]]로 둔다.
propertyDesc가 [[Enumerable]] field를 가지면, enumerable을 propertyDesc.[[Enumerable]]로 둔다; 그렇지 않으면 enumerable을 current.[[Enumerable]]으로 둔다.
object obj의 propertyKey라는 property를 data property로 replace하되, 그 [[Configurable]]과 [[Enumerable]] attribute는 각각 configurable과 enumerable로 설정하고, [[Value]]와 [[Writable]] attribute는 propertyDesc가 해당 field를 가지면 propertyDesc 안의 corresponding field의 value로, 그렇지 않으면 attribute의 default value로 설정한다.
그렇지 않으면,
propertyDesc의 각 field name fieldName에 대해, object obj의 propertyKey라는 property의 fieldName이라는 attribute를 propertyDesc의 fieldName field의 value로 설정한다.
The abstract operation OrdinaryHasProperty takes arguments obj (an Object) and propertyKey (a property key) and returns either a normal completion containing a Boolean or a throw completion. It performs the following steps when called:
hasOwn을 ? obj.[[GetOwnProperty]](propertyKey)로 둔다.
The abstract operation OrdinaryDelete takes arguments obj (an Object) and propertyKey (a property key) and returns either a normal completion containing a Boolean or a throw completion. It performs the following steps when called:
propertyDesc를 ? obj.[[GetOwnProperty]](propertyKey)로 둔다.
The abstract operation OrdinaryOwnPropertyKeys takes argument obj (an Object) and returns a List of property keys. It performs the following steps when called:
obj의 각 own property keypropertyKey 중 propertyKey가 array index인 것에 대해, ascending numeric index order로 다음을 수행한다.
propertyKey를 keys에 append한다.
obj의 각 own property keypropertyKey 중 propertyKey가 String이고 propertyKey가 array index가 아닌 것에 대해, property creation의 ascending chronological order로 다음을 수행한다.
propertyKey를 keys에 append한다.
obj의 각 own property keypropertyKey 중 propertyKey가 Symbol인 것에 대해, property creation의 ascending chronological order로 다음을 수행한다.
propertyKey를 keys에 append한다.
keys를 반환한다.
10.1.12 OrdinaryObjectCreate ( proto [ , additionalInternalSlotsList ] )
The abstract operation OrdinaryObjectCreate takes argument proto (an Object or null) and optional argument additionalInternalSlotsList (a List of names of internal slots) and returns an Object. 새 ordinary object의 runtime creation을 specify하는 데 사용됩니다. additionalInternalSlotsList는 [[Prototype]]과 [[Extensible]]을 넘어 object의 part로 define되어야 하는 additional internal slot의 name을 contain합니다. additionalInternalSlotsList가 provided되지 않으면, 새 empty List가 사용됩니다. It performs the following steps when called:
internalSlotsList를 « [[Prototype]], [[Extensible]] »로 둔다.
OrdinaryObjectCreate는 MakeBasicObject를 call하는 것 이상의 일을 거의 하지 않지만, 그 use는 exotic object가 아니라 ordinary object를 create하려는 intention을 communicate합니다. 따라서 이 명세 안에서는 result가 non-ordinary가 되도록 object의 internal method를 subsequently modify하는 algorithm에 의해 called되지 않습니다. exotic object를 create하는 operation은 MakeBasicObject를 직접 invoke합니다.
The abstract operation OrdinaryCreateFromConstructor takes arguments ctor (a function object) and intrinsicDefaultProto (a String) and optional argument internalSlotsList (a List of names of internal slots) and returns either a normal completion containing an Object or a throw completion. constructor의 "prototype" property가 존재하면 그 property에서 retrieved된 [[Prototype]] value를 가지는 ordinary object를 create합니다. 그렇지 않으면 intrinsicDefaultProto가 naming하는 intrinsic이 [[Prototype]]에 사용됩니다. internalSlotsList는 object의 part로 define되어야 하는 additional internal slot의 name을 contain합니다. internalSlotsList가 provided되지 않으면, 새 empty List가 사용됩니다. It performs the following steps when called:
Assert: intrinsicDefaultProto는 이 명세의 intrinsic object name이다. corresponding object는 object의 [[Prototype]] value로 사용되도록 intended된 intrinsic이어야 한다.
The abstract operation GetPrototypeFromConstructor takes arguments ctor (a function object) and intrinsicDefaultProto (a String) and returns either a normal completion containing an Object or a throw completion. specific constructor에 corresponding하는 object를 create하는 데 사용해야 하는 [[Prototype]] value를 determine합니다. value는 constructor의 "prototype" property가 존재하면 그 property에서 retrieved됩니다. 그렇지 않으면 intrinsicDefaultProto가 naming하는 intrinsic이 [[Prototype]]에 사용됩니다. It performs the following steps when called:
Assert: intrinsicDefaultProto는 이 명세의 intrinsic object name이다. corresponding object는 object의 [[Prototype]] value로 사용되도록 intended된 intrinsic이어야 한다.
ctor가 [[Prototype]] value를 supply하지 않으면, 사용되는 default value는 running execution context가 아니라 ctor function의 realm에서 obtained됩니다.
10.1.15 RequireInternalSlot ( obj, internalSlot )
The abstract operation RequireInternalSlot takes arguments obj (an ECMAScript language value) and internalSlot (an internal slot name) and returns either a normal completion containingunused or a throw completion. obj가 Object이고 given internal slot을 가지지 않는 한 exception을 throw합니다. It performs the following steps when called:
obj가 Object가 아니면, TypeError exception을 throw한다.
obj가 internalSlot internal slot을 가지지 않으면, TypeError exception을 throw한다.
function이 closed over된 Private Name에 대한 PrivateEnvironment Record입니다. 이 function이 syntactically class 안에 contained되어 있지 않으면 null입니다. function의 code를 evaluating할 때 inner class를 위한 outer PrivateEnvironment로 사용됩니다.
function의 formal parameter와 code body 안에서 this reference가 어떻게 interpreted되는지 define합니다. lexical은 this가 lexically enclosing function의 this value를 refer함을 의미합니다. strict는 this value가 function invocation에 의해 provided된 그대로 사용됨을 의미합니다. global은 undefined 또는 null인 this value가 global object에 대한 reference로 interpreted되고, 그 밖의 this value는 먼저 ToObject에 passed됨을 의미합니다.
step 7에서 calleeContext가 execution context stack에서 removed될 때, accessible Generator에 의해 later resumption을 위해 suspended되고 retained되어 있다면 destroyed되어서는 안 됩니다.
The abstract operation PrepareForOrdinaryCall takes arguments func (an ECMAScript function object) and newTarget (an Object or undefined) and returns an execution context. It performs the following steps when called:
The abstract operation OrdinaryCallBindThis takes arguments func (an ECMAScript function object), calleeContext (an execution context), and thisArg (an ECMAScript language value) and returns unused. It performs the following steps when called:
The abstract operation OrdinaryFunctionCreate takes arguments proto (an Object), sourceText (a sequence of Unicode code points), paramList (a Parse Node), body (a Parse Node), thisMode (lexical-this or non-lexical-this), envRecord (an Environment Record), and privateEnv (a PrivateEnvironment Record or null) and returns an ECMAScript function object. default [[Call]] internal method를 가지며 [[Construct]] internal method는 없는 새 function의 runtime creation을 specify하는 데 사용됩니다(단, MakeConstructor 같은 operation에 의해 subsequently added될 수 있습니다). sourceText는 created될 function의 syntactic definition의 source text입니다. It performs the following steps when called:
internalSlotsList를 Table 26에 listed된 internal slot으로 둔다.
The abstract operation AddRestrictedFunctionProperties takes arguments func (a function object) and realm (a Realm Record) and returns unused. It performs the following steps when called:
The abstract operation MakeConstructor takes argument func (an ECMAScript function object or a built-in function object) and optional arguments writableProto (a Boolean) and proto (an Object) and returns unused. func를 constructor로 convert합니다. It performs the following steps when called:
! DefinePropertyOrThrow(func, "prototype", PropertyDescriptor { [[Value]]: proto, [[Writable]]: writableProto, [[Enumerable]]: false, [[Configurable]]: false })를 수행한다.
unused를 반환한다.
10.2.6 MakeClassConstructor ( func )
The abstract operation MakeClassConstructor takes argument func (an ECMAScript function object) and returns unused. It performs the following steps when called:
The abstract operation MakeMethod takes arguments func (an ECMAScript function object) and homeObj (an Object) and returns unused. func를 method로 configure합니다. It performs the following steps when called:
10.2.9 SetFunctionName ( func, name [ , prefix ] )
The abstract operation SetFunctionName takes arguments func (a function object) and name (a property key or Private Name) and optional argument prefix (a String) and returns unused. func에 "name" property를 add합니다. It performs the following steps when called:
Assert: func는 "name" own property를 가지지 않는 extensible object이다.
The abstract operation SetFunctionLength takes arguments func (a function object) and length (a non-negative integer or +∞) and returns unused. func에 "length" property를 add합니다. It performs the following steps when called:
Assert: func는 "length" own property를 가지지 않는 extensible object이다.
ECMAScript function을 evaluating하기 위해 execution context가 established될 때 새 Function Environment Record가 created되고 각 formal parameter에 대한 binding이 그 Environment Record 안에 instantiated됩니다. function body 안의 각 declaration도 instantiated됩니다. function의 formal parameter가 default value initializer를 포함하지 않으면 body declaration은 parameter와 같은 Environment Record 안에 instantiated됩니다. default value parameter initializer가 존재하면 body declaration을 위해 두 번째 Environment Record가 created됩니다. Formal parameter와 function은 FunctionDeclarationInstantiation의 일부로 initialized됩니다. 다른 모든 binding은 function body의 evaluation 중에 initialized됩니다.
built-in function object는 “constructor”로 described되거나 이 명세의 어떤 algorithm이 그 [[Construct]] internal method를 explicit하게 set하는 경우에 and only if [[Construct]] internal method를 가집니다. 그러한 [[Construct]] internal method는 10.3.2의 definition을 conform해야 합니다.
implementation은 이 명세에 정의되지 않은 additional built-in function object를 provide할 수 있습니다.
resultsClosure를 func, thisArg, argList, newTarget을 capture하고 called될 때 다음 step을 수행하는, parameter가 없는 새 Abstract Closure로 둔다:
result를 func의 specification을 conform하는 manner로 func를 evaluating한 result인 Completion Record로 둔다. thisArg가 uninitialized이면, this value는 uninitialized입니다; 그렇지 않으면 thisArg가 this value를 제공합니다. argList는 named parameter를 제공합니다. newTarget은 NewTarget value를 제공합니다.
NOTE: func가 이 document에 defined되어 있으면, “func의 specification”은 algorithm step 또는 기타 means를 통해 그것에 대해 specified된 behaviour입니다.
result를 func의 specification을 conform하는 manner로 func를 evaluating한 result인 Completion Record로 둔다. thisArg가 uninitialized이면, this value는 uninitialized입니다; 그렇지 않으면 thisArg가 this value를 제공합니다. argList는 named parameter를 제공합니다. newTarget은 NewTarget value를 제공합니다.
NOTE: func가 이 document에 defined되어 있으면, “func의 specification”은 algorithm step 또는 기타 means를 통해 그것에 대해 specified된 behaviour입니다.
The abstract operation CreateBuiltinFunction takes arguments behaviour (an Abstract Closure, a set of algorithm steps, or some other definition of a function's behaviour provided in this specification), length (a non-negative integer or +∞), name (a property key or a Private Name), and additionalInternalSlotsList (a List of names of internal slots) and optional arguments realm (a Realm Record), proto (an Object or null), prefix (a String), and async (a Boolean) and returns a built-in function object. additionalInternalSlotsList는 object의 part로 define되어야 하는 additional internal slot의 name을 contain합니다. 이 operation은 built-in function object를 create합니다. It performs the following steps when called:
realm이 present하지 않으면, realm을 current Realm Record로 설정한다.
func를 called될 때 behaviour에 의해 specified된 corresponding parameter의 value로 provided argument를 사용하여 behaviour가 describe한 action을 수행하는 새 built-in function object로 둔다. 새 function object는 name이 internalSlotsList의 element인 internal slot과 [[InitialName]] internal slot을 가진다.
object의 [[Call]]과 (applicable하면) [[Construct]] internal method가 다음 implementation을 사용하고, 그 other essential internal method가 10.1에 있는 definition을 사용하면, 그 object는 bound function exotic object입니다. 이러한 method는 BoundFunctionCreate에서 installed됩니다.
Array는 array indexproperty key(6.1.7 참조)에 special treatment를 제공하는 exotic object입니다. property name이 array index인 property는 element라고도 합니다. 모든 Array는 non-configurable "length" property를 가지며, 그 value는 항상 mathematical value가 232보다 strictly less인 non-negative integral Number입니다. "length" property의 value는 name이 array index인 모든 own property의 name보다 numerically greater합니다; Array의 own property가 created되거나 changed될 때마다, 이 invariant를 maintain하기 위해 other property가 necessary하게 adjusted됩니다. Specifically, name이 array index인 own property가 added될 때마다, "length" property의 value는 필요하면 그 array index의 numeric value보다 하나 큰 값으로 changed됩니다; 그리고 "length" property의 value가 changed될 때마다, name이 array index이고 value가 new length보다 작지 않은 모든 own property는 deleted됩니다. 이 constraint는 Array의 own property에만 apply되며, 그 prototype에서 inherited될 수 있는 "length" 또는 array index property의 영향을 받지 않습니다.
object의 [[DefineOwnProperty]] internal method가 다음 implementation을 사용하고, 그 other essential internal method가 10.1에 있는 definition을 사용하면, 그 object는 Array exotic object(또는 simply, Array)입니다. 이러한 method는 ArrayCreate에서 installed됩니다.
The abstract operation ArrayCreate takes argument length (a non-negative integer) and optional argument proto (an Object) and returns either a normal completion containing an Array exotic object or a throw completion. 새 Array의 creation을 specify하는 데 사용됩니다. It performs the following steps when called:
The abstract operation ArraySpeciesCreate takes arguments originalArray (an Object) and length (a non-negative integer) and returns either a normal completion containing an Object or a throw completion. originalArray에서 derived된 constructor function을 사용하여 새 Array 또는 similar object의 creation을 specify하는 데 사용됩니다. constructor function이 Array를 return해야 한다고 enforce하지는 않습니다. It performs the following steps when called:
originalArray가 running execution context의 realm이 아닌 realm에 대한 standard built-in Array constructor를 사용하여 created되었다면, running execution context의 realm을 사용하여 새 Array가 created됩니다. 이는 역사적으로 ArraySpeciesCreate를 사용하여 now defined된 Array.prototype method에 대해 해당 behaviour를 가졌던 Web browser와의 compatibility를 maintain합니다.
array의 각 own property keypropertyKey 중 propertyKey가 array index이고 ! ToUint32(propertyKey) ≥ newLength인 것에 대해, descending numeric index order로 다음을 수행한다.
deleteSucceeded를 ! array.[[Delete]](propertyKey)로 둔다.
step 3 및 4에서, propertyDesc.[[Value]]가 object이면 그 valueOf method가 두 번 called됩니다. 이는 이 명세의 2nd Edition부터 이 effect로 specified된 legacy behaviour입니다.
10.4.3 String Exotic Objects
String object는 String value를 encapsulate하고 String value의 individual code unit element에 corresponding하는 virtual integer-indexeddata property를 expose하는 exotic object입니다. String exotic object는 항상 "length"라는 data property를 가지며, 그 value는 encapsulated String value의 length입니다. code unit data property와 "length" property는 모두 non-writable 및 non-configurable입니다.
object의 [[GetOwnProperty]], [[DefineOwnProperty]], [[OwnPropertyKeys]] internal method가 다음 implementation을 사용하고, 그 other essential internal method가 10.1에 있는 definition을 사용하면, 그 object는 String exotic object(또는 simply, String object)입니다. 이러한 method는 StringCreate에서 installed됩니다.
obj의 각 own property keypropertyKey 중 propertyKey가 String이고 propertyKey가 array index가 아닌 것에 대해, property creation의 ascending chronological order로 다음을 수행한다.
propertyKey를 keys에 append한다.
obj의 각 own property keypropertyKey 중 propertyKey가 Symbol인 것에 대해, property creation의 ascending chronological order로 다음을 수행한다.
propertyKey를 keys에 append한다.
keys를 반환한다.
10.4.3.4 StringCreate ( value, proto )
The abstract operation StringCreate takes arguments value (a String) and proto (an Object) and returns a String exotic object. 새 String exotic object의 creation을 specify하는 데 사용됩니다. It performs the following steps when called:
string을 MakeBasicObject(« [[Prototype]], [[Extensible]], [[StringData]] »)로 둔다.
string.[[Prototype]]을 proto로 설정한다.
string.[[StringData]]를 value로 설정한다.
string.[[GetOwnProperty]]를 10.4.3.1에 specified된 대로 설정한다.
string.[[DefineOwnProperty]]를 10.4.3.2에 specified된 대로 설정한다.
string.[[OwnPropertyKeys]]를 10.4.3.3에 specified된 대로 설정한다.
The abstract operation StringGetOwnProperty takes arguments string (an Object that has a [[StringData]] internal slot) and propertyKey (a property key) and returns a Property Descriptor or undefined. It performs the following steps when called:
object의 internal method가 다음 implementation을 사용하고, 여기서 specified되지 않은 것은 10.1에 있는 것을 사용하면, 그 object는 arguments exotic object입니다. 이러한 method는 CreateMappedArgumentsObject에서 installed됩니다.
Arguments exotic object는 ordinary object와 같은 internal slot을 가집니다. 또한 [[ParameterMap]] internal slot을 가집니다. Ordinary arguments object도 value가 항상 undefined인 [[ParameterMap]] internal slot을 가집니다. ordinary argument object의 경우 [[ParameterMap]] internal slot은 Object.prototype.toString(20.1.3.6)에 의해 그것을 그렇게 identify하는 데만 사용됩니다.
Note 2
numeric name value가 corresponding function object의 formal parameter 수보다 작은 arguments exotic object의 integer-indexeddata property는 initially function의 execution context 안의 corresponding argument binding과 그 value를 share합니다. 이는 property를 changing하면 corresponding argument binding의 value가 changed되고 그 반대도 성립함을 의미합니다. 그러한 property가 deleted된 다음 redefined되거나 property가 accessor property로 changed되면 이 correspondence는 broken됩니다. arguments object가 ordinary object이면, 그 property의 value는 단순히 function에 passed된 argument의 copy이며, property value와 formal parameter value 사이에 dynamic linkage는 없습니다.
Note 3
ParameterMap object와 그 property value는 arguments object correspondence to argument binding을 specifying하는 device로 사용됩니다. ParameterMap object와 그 property의 value인 object는 ECMAScript code에서 directly observable하지 않습니다. ECMAScript implementation은 specified semantics를 implement하기 위해 실제로 그러한 object를 create하거나 사용할 필요가 없습니다.
Note 4
Ordinary arguments object는 access 시 TypeError exception을 throw하는 "callee"라는 non-configurable accessor property를 define합니다. "callee" property는 일부 class의 non-strict function에 대해서만 created되는 arguments exotic object에 대해 더 specific한 meaning을 가집니다. ordinary variant에서 이 property의 definition은 conforming ECMAScript implementation이 다른 manner로 define하지 않도록 ensure하기 위해 존재합니다.
Note 5
arguments exotic object의 ECMAScript implementation은 역사적으로 "caller"라는 accessor property를 contained했습니다. ECMAScript 2017 이전에는, 이 명세가 ordinary arguments object 위의 throwing "caller" property의 definition을 포함했습니다. implementation이 더 이상 이 extension을 contain하지 않으므로, ECMAScript 2017은 throwing "caller" accessor에 대한 requirement를 dropped했습니다.
The abstract operation CreateUnmappedArgumentsObject takes argument argList (a List of ECMAScript language values) and returns an ordinary object. It performs the following steps when called:
The abstract operation MakeArgGetter takes arguments name (a String) and envRecord (an Environment Record) and returns a function object. executed될 때 envRecord 안에서 name에 bound된 value를 반환하는 built-in function object를 create합니다. It performs the following steps when called:
getterClosure를 name과 envRecord를 capture하고 called될 때 다음 step을 수행하는, parameter가 없는 새 Abstract Closure로 둔다:
NOTE: getter는 ECMAScript code에서 결코 directly accessible하지 않습니다.
getter를 반환한다.
10.4.4.7.2 MakeArgSetter ( name, envRecord )
The abstract operation MakeArgSetter takes arguments name (a String) and envRecord (an Environment Record) and returns a function object. executed될 때 envRecord 안에서 name에 bound된 value를 set하는 built-in function object를 create합니다. It performs the following steps when called:
setterClosure를 name과 envRecord를 capture하고 called될 때 다음 step을 수행하는, parameter (value)를 가진 새 Abstract Closure로 둔다:
TypedArray는 ordinary object와 같은 internal slot을 가지며, 추가로 [[ViewedArrayBuffer]], [[TypedArrayName]], [[ContentType]], [[ByteLength]], [[ByteOffset]], [[ArrayLength]] internal slot을 가집니다.
object의 [[PreventExtensions]], [[GetOwnProperty]], [[HasProperty]], [[DefineOwnProperty]], [[Get]], [[Set]], [[Delete]], [[OwnPropertyKeys]] internal method가 이 section의 definition을 사용하고, 그 other essential internal method가 10.1에 있는 definition을 사용하면, 그 object는 TypedArray입니다. 이러한 method는 TypedArrayCreate에 의해 installed됩니다.
10.4.5.1[[PreventExtensions]] ( )
The [[PreventExtensions]] internal method of a TypedArrayobj takes no arguments and returns a normal completion containing a Boolean. It performs the following steps when called:
NOTE: 6.1.7.3에 specified된 extensibility-related invariant는 obj가 property를 gain할 수 있을 때(또는 lose한 후 regain할 수 있을 때) 이 method가 true를 return하는 것을 allow하지 않습니다. 이는 underlying buffer가 resized될 때 integer index name을 가진 property에 대해 occur할 수 있습니다.
obj의 각 own property keypropertyKey 중 propertyKey가 String이고 propertyKey가 integer index가 아닌 것에 대해, property creation의 ascending chronological order로 다음을 수행한다.
propertyKey를 keys에 append한다.
obj의 각 own property keypropertyKey 중 propertyKey가 Symbol인 것에 대해, property creation의 ascending chronological order로 다음을 수행한다.
propertyKey를 keys에 append한다.
keys를 반환한다.
10.4.5.9 TypedArray With Buffer Witness Records
TypedArray With Buffer Witness Record는 viewed buffer의 cached byte length와 함께 TypedArray를 encapsulate하는 데 사용되는 Record value입니다. 이는 viewed buffer가 growable SharedArrayBuffer일 때 byte length data block의 single ReadSharedMemory event가 있음을 ensure하는 데 help하기 위해 사용됩니다.
TypedArray With Buffer Witness Record는 Table 28에 listed된 field를 가집니다.
Record가 created되었을 때 object의 [[ViewedArrayBuffer]]의 byte length입니다.
10.4.5.10 MakeTypedArrayWithBufferWitnessRecord ( obj, order )
The abstract operation MakeTypedArrayWithBufferWitnessRecord takes arguments obj (a TypedArray) and order (seq-cst or unordered) and returns a TypedArray With Buffer Witness Record. It performs the following steps when called:
The abstract operation TypedArrayCreate takes argument proto (an Object) and returns a TypedArray. 새 TypedArray의 creation을 specify하는 데 사용됩니다. It performs the following steps when called:
ta.[[OwnPropertyKeys]]를 10.4.5.8에 specified된 대로 설정한다.
ta.[[Prototype]]을 proto로 설정한다.
ta를 반환한다.
10.4.5.12 TypedArrayByteLength ( taRecord )
The abstract operation TypedArrayByteLength takes argument taRecord (a TypedArray With Buffer Witness Record) and returns a non-negative integer. It performs the following steps when called:
NOTE: underlying buffer가 non-integer multiple로 resized되었을 때도 returned byte length는 항상 elementSize의 integer multiple입니다.
length × elementSize를 반환한다.
10.4.5.13 TypedArrayLength ( taRecord )
The abstract operation TypedArrayLength takes argument taRecord (a TypedArray With Buffer Witness Record) and returns a non-negative integer. It performs the following steps when called:
The abstract operation IsTypedArrayOutOfBounds takes argument taRecord (a TypedArray With Buffer Witness Record) and returns a Boolean. object의 numeric property 중 어떤 것이 underlying buffer's bounds 안에 contained되지 않은 index의 value를 reference하는지 check합니다. It performs the following steps when called:
obj를 taRecord.[[Object]]로 둔다.
bufferByteLength를 taRecord.[[CachedBufferByteLength]]로 둔다.
The abstract operation IsValidIntegerIndex takes arguments obj (a TypedArray) and index (a Number) and returns a Boolean. It performs the following steps when called:
The abstract operation TypedArrayGetElement takes arguments obj (a TypedArray) and index (a Number) and returns a Number, a BigInt, or undefined. It performs the following steps when called:
SetValueInBuffer(obj.[[ViewedArrayBuffer]], byteIndexInBuffer, elementType, number, true, unordered)를 수행한다.
unused를 반환한다.
Note
이 operation은 항상 succeed하는 것처럼 보이지만, TypedArray의 end를 지나서 write하려고 하거나 detached ArrayBuffer가 backing하는 TypedArray에 write하려고 할 때는 effect가 없습니다.
10.4.5.19 IsArrayBufferViewOutOfBounds ( obj )
The abstract operation IsArrayBufferViewOutOfBounds takes argument obj (a TypedArray or a DataView) and returns a Boolean. TypedArray의 numeric property 중 어떤 것이나 DataView object의 method가 underlying data block's bounds 안에 contained되지 않은 index의 value를 reference할 수 있는지 check합니다. 이 abstract operation은 upstream specification을 위한 convenience로 존재합니다. It performs the following steps when called:
ResolveExport는 side-effect free입니다. 이 operation이 specific exportName, resolveSet pair를 argument로 called될 때마다 같은 result를 반환해야 합니다. implementation은 각 module namespace exotic object의 [[Exports]]에 대한 ResolveExport result를 pre-compute하거나 cache하도록 choose할 수 있습니다.
object의 [[SetPrototypeOf]] internal method가 다음 implementation을 사용하면, 그 object는 immutable prototype exotic object입니다. (그 other essential internal method는 문제의 specific immutable prototype exotic object에 따라 어떤 implementation이든 사용할 수 있습니다.)
The abstract operation SetImmutablePrototype takes arguments obj (an Object) and proto (an Object or null) and returns either a normal completion containing a Boolean or a throw completion. It performs the following steps when called:
10.5 Proxy Object Internal Methods and Internal Slots
Proxy object는 essential internal method가 ECMAScript code를 사용하여 partially implemented되는 exotic object입니다. 모든 Proxy object는 [[ProxyHandler]]라는 internal slot을 가집니다. [[ProxyHandler]]의 value는 proxy의 handler object라고 불리는 object 또는 null입니다. handler object의 method(Table 30 참조)는 Proxy object's internal method 중 하나 이상에 대한 implementation을 augment하는 데 사용될 수 있습니다. 모든 Proxy object는 또한 [[ProxyTarget]]이라는 internal slot을 가지며, 그 value는 object 또는 null입니다. 이 object를 proxy의 target object라고 합니다.
object의 essential internal method(applicable하면 [[Call]] 및 [[Construct]] 포함)가 이 section의 definition을 사용하면, 그 object는 Proxy exotic object입니다. 이러한 internal method는 ProxyCreate에서 installed됩니다.
Table 30: Proxy Handler Methods
Internal Method
Handler Method
[[GetPrototypeOf]]
getPrototypeOf
[[SetPrototypeOf]]
setPrototypeOf
[[IsExtensible]]
isExtensible
[[PreventExtensions]]
preventExtensions
[[GetOwnProperty]]
getOwnPropertyDescriptor
[[DefineOwnProperty]]
defineProperty
[[HasProperty]]
has
[[Get]]
get
[[Set]]
set
[[Delete]]
deleteProperty
[[OwnPropertyKeys]]
ownKeys
[[Call]]
apply
[[Construct]]
construct
Proxy object internal method의 implementation을 provide하기 위해 handler method가 called될 때, handler method에는 proxy의 target object가 parameter로 passed됩니다. proxy의 handler object가 모든 essential internal method에 corresponding하는 method를 반드시 가지는 것은 아닙니다. proxy 위에서 internal method를 invoking하면 handler object가 internal trap에 corresponding하는 method를 가지지 않는 경우 proxy의 target object 위의 corresponding internal method가 invoked됩니다.
Proxy object의 [[ProxyHandler]] 및 [[ProxyTarget]] internal slot은 object가 created될 때 항상 initialized되며 일반적으로 modified될 수 없습니다. 일부 Proxy object는 subsequently revoked될 수 있도록 허용하는 manner로 created됩니다. proxy가 revoked되면, 그 [[ProxyHandler]]와 [[ProxyTarget]] internal slot은 null로 set되어 이후 그 Proxy object 위의 internal method invocation이 TypeError exception을 throw하게 합니다.
Proxy object는 internal method의 implementation이 arbitrary ECMAScript code에 의해 provided되는 것을 permit하므로, handler method가 6.1.7.3에 정의된 invariant를 violate하는 Proxy object를 define하는 것이 가능합니다. 6.1.7.3에 정의된 internal method invariant 중 일부는 essential integrity invariant입니다. 이러한 invariant는 이 section에 specified된 Proxy object internal method에 의해 explicitly enforced됩니다. ECMAScript implementation은 가능한 모든 invariant violation이 presence하더라도 robust해야 합니다.
corresponding target object property가 non-writable, non-configurable own data property이면, property의 value를 corresponding target object property의 value와 다르게 change할 수 없습니다.
corresponding target object property가 [[Set]] attribute로 undefined를 가지는 non-configurable own accessor property이면, property의 value를 set할 수 없습니다.
Proxy exotic object는 그 [[ProxyTarget]] internal slot의 initial value가 [[Construct]] internal method를 가지는 object인 경우에만 [[Construct]] internal method를 가집니다.
Note 2
Proxy object의 [[Construct]]는 다음 invariant를 enforce합니다:
[[Construct]]의 result는 Object여야 합니다.
10.5.14 ValidateNonRevokedProxy ( proxy )
The abstract operation ValidateNonRevokedProxy takes argument proxy (a Proxy exotic object) and returns either a normal completion containingunused or a throw completion. proxy가 revoked되었으면 TypeError exception을 throw합니다. It performs the following steps when called: