Thu, 15 Jan 2015 21:03:48 +0100
Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)
1 // |jit-test| debug
2 // The onExceptionUnwind hook is called multiple times as the stack unwinds.
4 var g = newGlobal();
5 g.debuggeeGlobal = this;
6 g.dbg = null;
7 g.eval("(" + function () {
8 dbg = new Debugger(debuggeeGlobal);
9 dbg.onExceptionUnwind = function (frame, exc) {
10 assertEq(frame instanceof Debugger.Frame, true);
11 assertEq(exc instanceof Debugger.Object, true);
12 var s = '!';
13 for (var f = frame; f; f = f.older)
14 if (f.type === "call")
15 s += f.callee.name;
16 s += ', ';
17 debuggeeGlobal.log += s;
18 };
19 } + ")();");
21 var log;
23 function k() {
24 try {
25 throw new Error("oops"); // hook call 1
26 } finally {
27 log += 'k-finally, ';
28 } // hook call 2
29 }
31 function j() {
32 k(); // hook call 3
33 log += 'j-unreached, ';
34 }
36 function h() {
37 try {
38 j(); // hook call 4
39 log += 'h-unreached, ';
40 } catch (exc) {
41 log += 'h-catch, ';
42 throw exc; // hook call 5
43 }
44 }
46 function f() {
47 try {
48 h(); // hook call 6
49 } catch (exc) {
50 log += 'f-catch, ';
51 }
52 log += 'f-after, ';
53 }
55 log = '';
56 f();
57 g.dbg.enabled = false;
58 assertEq(log, '!kjhf, k-finally, !kjhf, !jhf, !hf, h-catch, !hf, !f, f-catch, f-after, ');