summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/onExceptionUnwind-resumption-01.js
blob: cccc444d79c5d51f60e31485d1462566d3b4d573 (plain)
1
2
3
4
5
6
7
8
9
// Check that an onExceptionUnwind hook can force a frame to return a value early.

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