Debian Codegraph @

js/src/jit-test/tests/debug/Frame-eval-27.js

raw
1 // Bug 1026477: Defining functions with D.F.p.eval works, even if there's
2 // already a var binding for the identifier.
3
4 var g = newGlobal({newCompartment: true});
5 var dbg = new Debugger(g);
6 dbg.onDebuggerStatement = function (frame) {
7 frame.eval('function f() { }');
8 };
9
10 // When the compiler sees the 'debugger' statement, it marks all variables as
11 // aliased, so f will live in a Call object.
12 assertEq(typeof g.eval('(function () { var f = 42; debugger; return f;})();'),
13 "function");