зеркало из https://github.com/mozilla/pjs.git
Bug 717417: Don't skip ScriptDebugEpilogue when an onExceptionUnwind handler throws an uncaught exception or terminates the debuggee. r=jorendorff
This commit is contained in:
Родитель
7b79b25e7d
Коммит
9f8cafaa7b
|
@ -0,0 +1,18 @@
|
|||
// Ensure that ScriptDebugEpilogue gets called when onExceptionUnwind
|
||||
// throws an uncaught exception.
|
||||
var g = newGlobal('new-compartment');
|
||||
var dbg = Debugger(g);
|
||||
var frame;
|
||||
dbg.onExceptionUnwind = function (f, x) {
|
||||
frame = f;
|
||||
assertEq(frame.live, true);
|
||||
throw 'unhandled';
|
||||
};
|
||||
dbg.onDebuggerStatement = function(f) {
|
||||
assertEq(f.eval('throw 42'), null);
|
||||
assertEq(frame.live, false);
|
||||
};
|
||||
g.eval('debugger');
|
||||
|
||||
// Don't fail just because we reported an uncaught exception.
|
||||
quit(0);
|
|
@ -0,0 +1,15 @@
|
|||
// Ensure that ScriptDebugEpilogue gets called when onExceptionUnwind
|
||||
// terminates execution.
|
||||
var g = newGlobal('new-compartment');
|
||||
var dbg = Debugger(g);
|
||||
var frame;
|
||||
dbg.onExceptionUnwind = function (f, x) {
|
||||
frame = f;
|
||||
assertEq(frame.live, true);
|
||||
return null;
|
||||
};
|
||||
dbg.onDebuggerStatement = function(f) {
|
||||
assertEq(f.eval('throw 42'), null);
|
||||
assertEq(frame.live, false);
|
||||
};
|
||||
g.eval('debugger');
|
|
@ -0,0 +1,16 @@
|
|||
// Ensure that ScriptDebugEpilogue gets called when onExceptionUnwind
|
||||
// terminates execution.
|
||||
var g = newGlobal('new-compartment');
|
||||
var dbg = Debugger(g);
|
||||
var frame;
|
||||
dbg.onExceptionUnwind = function (f, x) {
|
||||
frame = f;
|
||||
assertEq(frame.type, 'eval');
|
||||
assertEq(frame.live, true);
|
||||
terminate();
|
||||
};
|
||||
dbg.onDebuggerStatement = function(f) {
|
||||
assertEq(f.eval('throw 42'), null);
|
||||
assertEq(frame.live, false);
|
||||
};
|
||||
g.eval('debugger');
|
|
@ -547,10 +547,10 @@ js_InternalThrow(VMFrame &f)
|
|||
switch (st) {
|
||||
case JSTRAP_ERROR:
|
||||
cx->clearPendingException();
|
||||
return NULL;
|
||||
break;
|
||||
|
||||
case JSTRAP_CONTINUE:
|
||||
break;
|
||||
break;
|
||||
|
||||
case JSTRAP_RETURN:
|
||||
cx->clearPendingException();
|
||||
|
|
Загрузка…
Ссылка в новой задаче