summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/uncaughtExceptionHook-resumption-01.js
blob: b31c0972a000fab46340b92fbcaa6c13370867f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// uncaughtExceptionHook returns a resumption value.

load(libdir + "asserts.js");

var g = newGlobal();
var dbg = new Debugger(g);
var rv;
dbg.onDebuggerStatement = function () { throw 15; };
dbg.uncaughtExceptionHook = function (exc) {
    assertEq(exc, 15);
    return rv;
};

// case 1: undefined
rv = undefined;
g.eval("debugger");

// case 2: throw
rv = {throw: 57};
var result;
assertThrowsValue(function () { g.eval("debugger"); }, 57);

// case 3: return
rv = {return: 42};
assertEq(g.eval("debugger;"), 42);