summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/gc/bug1600488-2.js
blob: c7de44f1a06b17fb403c0b1ff758be776780cf56 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
const token = {};
let iterated;
const finalizationRegistry = new FinalizationRegistry(items => {
    iterated = items.next().value;
});
{
    let object = {};
    finalizationRegistry.register(object, token, token);
    object = undefined;
}
gc();
assertEq(finalizationRegistry.unregister(token), true);
finalizationRegistry.cleanupSome();
assertEq(iterated, undefined);