summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/modules/off-thread-compile.js
blob: 80de986c6fb54b625d8a435f6541dad59fcf06ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// |jit-test| skip-if: helperThreadCount() === 0

// Test off thread module compilation.

load(libdir + "asserts.js");

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

offThreadParseAndEvaluate("export let x = 2 * 3;");