blob: 567c7a84ab5e009e8e88933de681550bcb8486c6 [file] [log] [blame] [edit]
function assertNotUndefined(x) {
if (x === undefined)
throw new Error("Bad assertion!");
}
let weakRefs = [];
let functions = [];
for (let i = 0; i < 1000; ++i) {
let o = { i };
weakRefs.push(new WeakRef(o));
functions.push(createNoopNativeFunctionWithCapture(o));
}
setTimeout(() => {
gc();
for (let weakRef of weakRefs) {
assertNotUndefined(weakRef.deref());
}
});