Debian Codegraph @

js/src/jit-test/tests/xdr/option-mismatch.js

raw
1 var source = `
2 function f() {
3 function g() {
4 return 10;
5 }
6 return g();
7 }
8
9 f()`
10
11 var code = cacheEntry(source);
12
13
14 var res = evaluate(code, { saveBytecodeWithDelazifications: true, })
15 assertEq(res, 10)
16
17 try {
18 // We should throw here because we have incompatible options!
19 res = evaluate(code, { loadBytecode: true, sourceIsLazy: true })
20 assertEq(true, false);
21 } catch (e) {
22 assertEq(/Incompatible cache contents/.test(e.message), true);
23 }