summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Environment-callee-04.js
blob: b2b9534d0723401eb356c0e52d75777272ae75aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// We shouldn't hand out environment callees when we can only provide the
// internal function object, not the live function object. (We should never
// create Debugger.Object instances referring to internal function objects.)

var g = newGlobal();
var dbg = new Debugger(g);

dbg.onDebuggerStatement = function (frame) {
  assertEq(frame.older.environment.parent.callee, null);
}

g.evaluate(`

           function h() { debugger; }
           (function () {
             return function () {
               h();
               return 1;
             }
           })()();

           `);