blob: 888ae40a07ef0be30a736788200fb41697031bad (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
// Allocate the object in the function to prevent marked as a singleton so the
// object won't be kept alive by IC stub.
function allocObj() { return {}; }
let wr;
{
let obj = allocObj();
wr = new WeakRef(obj);
}
assertEq(wr.deref() !== undefined, true);
clearKeptObjects();
gc();
assertEq(wr.deref(), undefined);
|