summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Script-getChildScripts-05.js
blob: ffdfcd0e200f686770c29a56dfaadc2a5195d5f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// Test that lazy inner functions inside eval are tagged properly so we don't
// incorrectly do NAME -> GNAME optimization.

var g = newGlobal();
var dbg = new Debugger(g);
dbg.onNewScript = function delazify(script, global) {
  // Force delazification of inner functions.
  script.getChildScripts();
};

g.eval("" + function f() {
  var $;
  eval('var obj={foo:1}; $=function() { assertEq(obj.foo, 1); }');
  return $;
});
g.eval("f()();");