summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/self-test/oom-test-bug1497906.js
blob: 2acca432d011eefeac6588479865c5047e6019d4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// |jit-test| skip-if: !(hasFunction.oomTest && hasFunction.stackTest) || helperThreadCount() === 0

// Check that oomTest throws an exception on worker threads.

setSharedObject(0);
evalInWorker(`
    try {
        oomTest(crash);
    } catch (e) {
        if (e.toString().includes("main thread")) {
            setSharedObject(1);
        }
    }
`);

while (getSharedObject() != 1) {
    // poor-man wait condition.
}