Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 // |jit-test| debug
2 // Don't allow cycles in the graph of the compartment "debugs" relation.
4 load(libdir + "asserts.js");
6 // trivial cycles
7 var dbg = new Debugger;
8 assertThrowsInstanceOf(function () { dbg.addDebuggee(this); }, TypeError);
9 assertThrowsInstanceOf(function () { new Debugger(this); }, TypeError);
11 // cycles of length 2
12 var d1 = newGlobal();
13 d1.top = this;
14 d1.eval("var dbg = new Debugger(top)");
15 assertThrowsInstanceOf(function () { dbg.addDebuggee(d1); }, TypeError);
16 assertThrowsInstanceOf(function () { new Debugger(d1); }, TypeError);
18 // cycles of length 3
19 var d2 = newGlobal();
20 d2.top = this;
21 d2.eval("var dbg = new Debugger(top.d1)");
22 assertThrowsInstanceOf(function () { dbg.addDebuggee(d2); }, TypeError);
23 assertThrowsInstanceOf(function () { new Debugger(d2); }, TypeError);