18 ECMAScript Standard Built-in Objects

ECMAScript Script 또는 Module이 execution을 begin할 때마다 사용할 수 있는 certain built-in object가 있습니다. 하나인 global object는 executing program의 global environment의 part입니다. 다른 것들은 global object의 initial property로, 또는 accessible built-in object의 property로 indirect하게 accessible합니다.

달리 specified되지 않는 한, function으로 callable한 built-in object는 10.3에 described된 characteristic을 가진 built-in function object입니다. 달리 specified되지 않는 한, built-in object의 [[Extensible]] internal slot은 initially value true를 가집니다. 모든 built-in function object는 object가 initially created된 realmRealm Record를 value로 가지는 [[Realm]] internal slot을 가집니다.

많은 built-in object는 function입니다: arguments와 함께 invoked될 수 있습니다. 그중 일부는 further constructor입니다: new operator와 함께 사용되도록 intended된 function입니다. 각 built-in function에 대해, 이 specification은 해당 function에 required되는 arguments와 그 function object의 property를 describe합니다. 각 built-in constructor에 대해, 이 specification은 further 해당 constructor의 prototype object의 property와 그 constructor를 invoke하는 new expression에 의해 returned되는 specific object instance의 property를 describe합니다.

particular function의 description에 달리 specified되지 않는 한, built-in function 또는 constructor에 specified된 require 수보다 fewer arguments가 given되면, function 또는 constructor는 sufficient additional arguments가 given된 것과 exactly 같이 behave해야 하며, each such argument는 undefined value입니다. such missing arguments는 “not present”로 considered되고 specification algorithm에서 that manner로 identified될 수 있습니다. particular function의 description에서 “this value” 및 “NewTarget”이라는 term은 10.3에 given된 meaning을 가집니다.

particular function의 description에 달리 specified되지 않는 한, described built-in function 또는 constructor에 function이 allow하도록 specified된 것보다 more arguments가 given되면, extra arguments는 call에 의해 evaluated된 다음 function에 의해 ignored됩니다. 그러나 implementation은 such arguments와 관련한 implementation specific behaviour를 define할 수 있으며, 단 그 behaviour가 단순히 extra argument의 presence에 predicated된 TypeError exception의 throwing이어서는 안 됩니다.

Note 1

built-in function의 set에 additional capability를 add하는 implementation은 existing function에 new parameter를 add하는 것보다 new function을 add하는 방식으로 doing so할 것이 encouraged됩니다.

달리 specified되지 않는 한 모든 built-in function 및 모든 built-in constructorFunction prototype object, 즉 expression Function.prototype(20.2.3)의 initial value를 그 [[Prototype]] internal slot의 value로 가집니다.

달리 specified되지 않는 한 모든 built-in prototype object는 Object prototype object, 즉 expression Object.prototype(20.1.3)의 initial value를 그 [[Prototype]] internal slot의 value로 가집니다. 단 Object prototype object itself는 제외합니다.

이 specification이 algorithm step을 통해 built-in constructor의 behaviour를 define하는 경우, 그것이 [[Call]][[Construct]] 둘 다의 purposes에 대한 behaviour입니다. such algorithm이 두 case를 distinguish할 필요가 있으면, NewTarget이 undefined인지 check하며, 이는 [[Call]] invocation을 indicate합니다.

constructor로 identified되지 않은 built-in function object는 particular function의 description에 달리 specified되지 않는 한 [[Construct]] internal method를 implement하지 않습니다.

constructor가 아닌 built-in function object는 particular function의 description에 달리 specified되지 않는 한 "prototype" property를 가지지 않습니다.

이 specification에 defined된 각 built-in function은 CreateBuiltinFunction abstract operation(10.3.4)을 calling하여 created됩니다. lengthname parameter의 value는 below에서 discussed되는 "length""name" property의 initial value입니다. prefix parameter의 value도 similarly below에서 discussed됩니다.

constructor를 include한 모든 built-in function object는 non-negative integral Number인 value를 가진 "length" property를 가집니다. 달리 specified되지 않는 한, 이 value는 function description의 subclause heading에 shown된 required parameter의 수입니다. Optional parameter와 rest parameter는 parameter count에 included되지 않습니다.

Note 2

예를 들어, Array prototype object"map" property의 initial value인 function object는 subclause heading «Array.prototype.map (callback [ , thisArg])» 아래에 described되며, 여기에는 named argument callback과 thisArg 두 개가 shown되고 latter는 optional입니다; 따라서 그 function object"length" property의 value는 1𝔽입니다.

달리 specified되지 않는 한, built-in function object"length" property는 attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }를 가집니다.

constructor를 include한 모든 built-in function object는 String인 value를 가진 "name" property를 가집니다. 달리 specified되지 않는 한, 이 value는 이 specification에서 function에 given되는 name입니다. anonymous function으로 identified되는 function은 "name" property의 value로 empty String을 사용합니다. object의 property로 specified되는 function의 경우, name value는 function에 access하는 데 사용되는 property name string입니다. built-in property의 get 또는 set accessor function으로 specified되는 function은 CreateBuiltinFunction을 calling할 때 prefix parameter에 "get" 또는 "set"(respectively)이 passed됩니다.

"name" property의 value는 property key가 Symbol value인 각 built-in function에 대해 explicitly specified됩니다. such explicitly specified된 value가 prefix "get " 또는 "set "으로 start하고 그것이 specified되는 function이 built-in property의 get 또는 set accessor function인 경우, prefix 없는 value가 name parameter에 passed되고, value "get" 또는 "set"(respectively)이 CreateBuiltinFunction을 calling할 때 prefix parameter에 passed됩니다.

달리 specified되지 않는 한, built-in function object"name" property는 attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }를 가집니다.

clause 19부터 28까지 및 Annex B.2에 described된 every other data property는 달리 specified되지 않는 한 attributes { [[Writable]]: true, [[Enumerable]]: false, [[Configurable]]: true }를 가집니다.

clause 19부터 28까지 및 Annex B.2에 described된 every accessor property는 달리 specified되지 않는 한 attributes { [[Enumerable]]: false, [[Configurable]]: true }를 가집니다. get accessor function만 described된 경우, set accessor function은 default value인 undefined입니다. set accessor만 described된 경우 get accessor는 default value인 undefined입니다.