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