1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/jit-test/tests/debug/uncaughtExceptionHook-01.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,19 @@ 1.4 +// Uncaught exceptions in the debugger itself are delivered to the 1.5 +// uncaughtExceptionHook. 1.6 + 1.7 +var g = newGlobal(); 1.8 +var dbg = new Debugger(g); 1.9 +var log; 1.10 +dbg.onDebuggerStatement = function () { 1.11 + log += 'x'; 1.12 + throw new TypeError("fail"); 1.13 +}; 1.14 +dbg.uncaughtExceptionHook = function (exc) { 1.15 + assertEq(this, dbg); 1.16 + assertEq(exc instanceof TypeError, true); 1.17 + log += '!'; 1.18 +}; 1.19 + 1.20 +log = ''; 1.21 +g.eval("debugger"); 1.22 +assertEq(log, 'x!');