mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 677371 - [jsdbg2] Assertion failure: throwing, at jscntxt.h:1274. r=jimb
This commit is contained in:
parent
d8123ebf1c
commit
bd42d5ffc4
15
js/src/jit-test/tests/debug/onExceptionUnwind-07.js
Normal file
15
js/src/jit-test/tests/debug/onExceptionUnwind-07.js
Normal file
@ -0,0 +1,15 @@
|
||||
// Unwinding due to uncatchable errors does not trigger onExceptionUnwind.
|
||||
|
||||
var g = newGlobal('new-compartment');
|
||||
var dbg = Debugger(g);
|
||||
var hits = 0;
|
||||
dbg.onExceptionUnwind = function (frame, value) { hits = 'BAD'; };
|
||||
dbg.onDebuggerStatement = function (frame) {
|
||||
if (hits++ === 0)
|
||||
assertEq(frame.eval("debugger;"), null);
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
assertEq(g.eval("debugger; 2"), 2);
|
||||
assertEq(hits, 2);
|
@ -466,32 +466,34 @@ js_InternalThrow(VMFrame &f)
|
||||
|
||||
jsbytecode *pc = NULL;
|
||||
for (;;) {
|
||||
// Call the throw hook if necessary
|
||||
JSThrowHook handler = cx->debugHooks->throwHook;
|
||||
if (handler || !cx->compartment->getDebuggees().empty()) {
|
||||
Value rval;
|
||||
JSTrapStatus st = Debugger::onExceptionUnwind(cx, &rval);
|
||||
if (st == JSTRAP_CONTINUE && handler) {
|
||||
st = handler(cx, cx->fp()->script(), cx->regs().pc, Jsvalify(&rval),
|
||||
cx->debugHooks->throwHookData);
|
||||
}
|
||||
if (cx->isExceptionPending()) {
|
||||
// Call the throw hook if necessary
|
||||
JSThrowHook handler = cx->debugHooks->throwHook;
|
||||
if (handler || !cx->compartment->getDebuggees().empty()) {
|
||||
Value rval;
|
||||
JSTrapStatus st = Debugger::onExceptionUnwind(cx, &rval);
|
||||
if (st == JSTRAP_CONTINUE && handler) {
|
||||
st = handler(cx, cx->fp()->script(), cx->regs().pc, Jsvalify(&rval),
|
||||
cx->debugHooks->throwHookData);
|
||||
}
|
||||
|
||||
switch (st) {
|
||||
case JSTRAP_ERROR:
|
||||
cx->clearPendingException();
|
||||
return NULL;
|
||||
switch (st) {
|
||||
case JSTRAP_ERROR:
|
||||
cx->clearPendingException();
|
||||
return NULL;
|
||||
|
||||
case JSTRAP_RETURN:
|
||||
cx->clearPendingException();
|
||||
cx->fp()->setReturnValue(rval);
|
||||
return cx->jaegerCompartment()->forceReturnFromExternC();
|
||||
case JSTRAP_RETURN:
|
||||
cx->clearPendingException();
|
||||
cx->fp()->setReturnValue(rval);
|
||||
return cx->jaegerCompartment()->forceReturnFromExternC();
|
||||
|
||||
case JSTRAP_THROW:
|
||||
cx->setPendingException(rval);
|
||||
break;
|
||||
case JSTRAP_THROW:
|
||||
cx->setPendingException(rval);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user