summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/gc/bug-1600238.js
blob: 6b6aeb85acf1071d77ced9b75615a0a5c7598394 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
gczeal(0);
newGlobal();
nukeAllCCWs();
function f() {
    global = newGlobal({
        newCompartment: true
    });
    try {
        return global.eval("new FinalizationRegistry(function(){})");
    } catch (e) {
        if (e instanceof TypeError && e.message.includes('dead')) {
            // Creating a new CCW to the global fails with
            // --more-compartments option.
            quit();
        }
        throw e;
    }
}
r = f();
r.register({}, {}, {});
startgc();