Debian Codegraph @

js/src/tests/test262/built-ins/WeakRef/instance-extensible.js

raw
1 // |reftest| skip-if(!this.hasOwnProperty('WeakRef')) -- WeakRef is not enabled unconditionally
2 // Copyright (C) 2019 Leo Balter. All rights reserved.
3 // This code is governed by the BSD license found in the LICENSE file.
4
5 /*---
6 esid: sec-weak-ref-target
7 description: Instances of WeakRef are extensible
8 info: |
9 WeakRef( target )
10
11 ...
12 3. Let weakRef be ? OrdinaryCreateFromConstructor(NewTarget, "%WeakRefPrototype%", « [[Target]] »).
13 4. Perfom ! KeepDuringJob(target).
14 5. Set weakRef.[[Target]] to target.
15 6. Return weakRef.
16
17 OrdinaryCreateFromConstructor ( constructor, intrinsicDefaultProto [ , internalSlotsList ] )
18
19 ...
20 2. Let proto be ? GetPrototypeFromConstructor(constructor, intrinsicDefaultProto).
21 3. Return ObjectCreate(proto, internalSlotsList).
22
23 ObjectCreate ( proto [ , internalSlotsList ] )
24
25 4. Set obj.[[Prototype]] to proto.
26 5. Set obj.[[Extensible]] to true.
27 6. Return obj.
28 features: [WeakRef, Reflect]
29 ---*/
30
31 var wr = new WeakRef({});
32 assert.sameValue(Object.isExtensible(wr), true);
33
34 reportCompare(0, 0);