Debian Codegraph @

js/src/jit-test/tests/xdr/debug-lazy.js

raw
1 load(libdir + 'bytecode-cache.js');
2
3 // Ensure that if a function is encoded when non-lazy but relazifiable, then
4 // decoded, the resulting script is marked as being non-lazy so that when the
5 // debugger tries to delazify things it doesn't get all confused. We just use
6 // findScripts() to trigger debugger delazification; we don't really care about
7 // the scripts themselves.
8 function checkAfter(ctx) {
9 var dbg = new Debugger(ctx.global);
10 var allScripts = dbg.findScripts();
11 assertEq(allScripts.length == 0, false);
12 }
13
14 test = `
15 function f() { return true; };
16 f();
17 `
18 evalWithCache(test, { assertEqBytecode: true, assertEqResult: true,
19 checkAfter: checkAfter, newCompartment: true});