summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/xdr/option-mismatch.js
blob: b6b27fffe54003bc24b9dc035275b60e1a299f7c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
var source = `
function f() {
    function g() {
        return 10;
    }
    return g();
}

f()`

var code = cacheEntry(source);


var res = evaluate(code, { saveIncrementalBytecode: true, })
assertEq(res, 10)

try {
    // We should throw here because we have incompatible options!
    res = evaluate(code, { loadBytecode: true, sourceIsLazy: true })
    assertEq(true, false);
} catch (e) {
    assertEq(/Incompatible cache contents/.test(e.message), true);
}