summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/modules/offthread-oom.js
blob: 97b783c1ba0977fdacca9bf543f039bf9dad5662 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// |jit-test| skip-if: !('oomTest' in this) || helperThreadCount() === 0

// Test Out-of-Memory handling when parsing modules off-thread

function offThreadParseAndEvaluate(source) {
    offThreadCompileModuleToStencil(source);
    let stencil = finishOffThreadStencil();
    let m = instantiateModuleStencil(stencil);
    moduleLink(m);
    return moduleEvaluate(m);
}

oomTest(() => offThreadParseAndEvaluate(`export let i = 2 * 3;`));