summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/self-test/cacheEntry.js
blob: d60671b60231521cc05efda5ee80f7fa2a7a8734 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// These tests are checking that CacheEntry_getBytecode properly set an error
// when there is no bytecode registered.
var caught = 0;
var code = cacheEntry("");
try {
    offThreadDecodeStencil(code);
}
catch (e) {
    // offThreadDecodeStencil does not work with the --no-thread command line option.
    assertEq(e.message.includes("CacheEntry") || e.message.includes("offThreadDecodeStencil"), true);
    caught++;
}

code = cacheEntry("");
try {
    evaluate(code, {loadBytecode: true});
}
catch (e) {
    assertEq(e.message.includes("CacheEntry"), true);
    caught++;
}

assertEq(caught, 2);