1
// Storing a Debugger.Object as a key in a WeakMap protects it from GC as long as
2
// the referent is alive.
4
var g = newGlobal('new-compartment');
7
var cache = new WeakMap;
10
dbg.onDebuggerStatement = function (frame) {
11
cache.set(frame.arguments[0], i++);
13
g.eval("function f(x) { debugger; }");
14
g.eval("var arr = [], j; for (j = 0; j < N; j++) arr[j] = {};");
15
g.eval("for (j = 0; j < N; j++) f(arr[j]);");
21
dbg.onDebuggerStatement = function (frame) {
22
assertEq(cache.get(frame.arguments[0]), i++)
24
g.eval("for (j = 0; j < N; j++) f(arr[j]);");