Make the JS debugger consistently ignore dummy frames, fixing an assertion failure. Bug 678086, r=jimb.

This commit is contained in:
Jason Orendorff 2012-01-27 14:16:22 -06:00
parent 68e5914814
commit bf70c01d6a
3 changed files with 11 additions and 2 deletions

View File

@ -0,0 +1,9 @@
// Debugger.prototype.getNewestFrame() ignores dummy frames.
// See bug 678086.
var g = newGlobal('new-compartment');
g.f = function () { return dbg.getNewestFrame(); };
var dbg = new Debugger;
var gw = dbg.addDebuggee(g);
var fw = gw.getOwnPropertyDescriptor("f").value;
assertEq(fw.call().return, null);

View File

@ -2562,7 +2562,7 @@ DebuggerFrame_getOlder(JSContext *cx, uintN argc, Value *vp)
THIS_FRAME(cx, argc, vp, "get this", args, thisobj, thisfp);
Debugger *dbg = Debugger::fromChildJSObject(thisobj);
for (StackFrame *fp = thisfp->prev(); fp; fp = fp->prev()) {
if (!fp->isDummyFrame() && dbg->observesFrame(fp))
if (dbg->observesFrame(fp))
return dbg->getScriptFrame(cx, fp, vp);
}
args.rval().setNull();

View File

@ -483,7 +483,7 @@ Debugger::observesGlobal(GlobalObject *global) const
bool
Debugger::observesFrame(StackFrame *fp) const
{
return observesGlobal(&fp->scopeChain().global());
return !fp->isDummyFrame() && observesGlobal(&fp->scopeChain().global());
}
JSTrapStatus