summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/onExceptionUnwind-resumption-03.js
blob: f18290f15fb231abe1c4c943cb3d309b7a84c094 (plain)
1
2
3
4
5
6
7
8
9
10
11
// Check that an onExceptionUnwind hook can force a frame to throw a different exception.

load(libdir + "asserts.js");

var g = newGlobal({newCompartment: true});
var dbg = Debugger(g);
dbg.onExceptionUnwind = function (frame, exc) {
    return { throw:"sproon" };
};
g.eval("function f() { throw 'ksnife'; }");
assertThrowsValue(g.f, "sproon");