instance-extensible.js (960B)
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-weak-ref-target 6 description: Instances of WeakRef are extensible 7 info: | 8 WeakRef( target ) 9 10 ... 11 3. Let weakRef be ? OrdinaryCreateFromConstructor(NewTarget, "%WeakRefPrototype%", « [[Target]] »). 12 4. Perfom ! KeepDuringJob(target). 13 5. Set weakRef.[[Target]] to target. 14 6. Return weakRef. 15 16 OrdinaryCreateFromConstructor ( constructor, intrinsicDefaultProto [ , internalSlotsList ] ) 17 18 ... 19 2. Let proto be ? GetPrototypeFromConstructor(constructor, intrinsicDefaultProto). 20 3. Return ObjectCreate(proto, internalSlotsList). 21 22 ObjectCreate ( proto [ , internalSlotsList ] ) 23 24 4. Set obj.[[Prototype]] to proto. 25 5. Set obj.[[Extensible]] to true. 26 6. Return obj. 27 features: [WeakRef, Reflect] 28 ---*/ 29 30 var wr = new WeakRef({}); 31 assert.sameValue(Object.isExtensible(wr), true); 32 33 reportCompare(0, 0);