michael@0: // Nested compilation units (say, an eval with in an eval) should have the michael@0: // correct sources attributed to them. michael@0: let g = newGlobal(); michael@0: let dbg = new Debugger(g); michael@0: michael@0: var count = 0; michael@0: dbg.onNewScript = function (script) { michael@0: ++count; michael@0: if (count % 2 == 0) michael@0: assertEq(script.source.text, text); michael@0: } michael@0: michael@0: g.eval("eval('" + (text = "") + "')"); michael@0: g.eval("eval('" + (text = "2 * 3") + "')"); michael@0: g.eval("new Function('" + (text = "") + "')"); michael@0: g.eval("new Function('" + (text = "2 * 3") + "')"); michael@0: evaluate("", { global: g }); michael@0: evaluate("2 * 3", { global: g }); michael@0: assertEq(count, 10);