instance-extensible.js (1441B)
1 // Copyright (C) 2019 Leo Balter. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 4 /*--- 5 esid: sec-Intl.DisplayNames 6 description: > 7 Instance is extensible 8 info: | 9 Intl.DisplayNames ( locales , options ) 10 11 1. If NewTarget is undefined, throw a TypeError exception. 12 2. Let displayNames be ? OrdinaryCreateFromConstructor(NewTarget, "%DisplayNamesPrototype%", 13 « [[InitializedDisplayNames]], [[Locale]], [[Style]], [[Type]], [[Fallback]], [[Fields]] »). 14 ... 15 12. Let type be ? GetOption(options, "type", "string", « "language", "region", "script", "currency" », undefined). 16 13. If type is undefined, throw a TypeError exception. 17 ... 18 19 OrdinaryCreateFromConstructor ( constructor, intrinsicDefaultProto [ , internalSlotsList ] ) 20 21 ... 22 2. Let proto be ? GetPrototypeFromConstructor(constructor, intrinsicDefaultProto). 23 3. Return ObjectCreate(proto, internalSlotsList). 24 25 ObjectCreate ( proto [ , internalSlotsList ] ) 26 27 ... 28 2. Let obj be a newly created object with an internal slot for each name in internalSlotsList. 29 3. Set obj's essential internal methods to the default ordinary object definitions specified in 9.1. 30 4. Set obj.[[Prototype]] to proto. 31 5. Set obj.[[Extensible]] to true. 32 6. Return obj. 33 features: [Intl.DisplayNames] 34 ---*/ 35 36 var obj = new Intl.DisplayNames(undefined, {type: 'language'}); 37 38 assert(Object.isExtensible(obj)); 39 40 reportCompare(0, 0);