Debian Codegraph @

js/src/jit-test/tests/debug/onExceptionUnwind-resumption-03.js

raw
1 // Check that an onExceptionUnwind hook can force a frame to throw a different exception.
2
3 load(libdir + "asserts.js");
4
5 var g = newGlobal({newCompartment: true});
6 var dbg = Debugger(g);
7 dbg.onExceptionUnwind = function (frame, exc) {
8 return { throw:"sproon" };
9 };
10 g.eval("function f() { throw 'ksnife'; }");
11 assertThrowsValue(g.f, "sproon");