mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 03:15:11 +00:00
Bug 960108 - Ignore saved frame chains and contexts in JS::DescribeStack. r=bz
This commit is contained in:
parent
08be7cc27e
commit
ef09518a17
@ -939,7 +939,10 @@ JS::DescribeStack(JSContext *cx, unsigned maxFrames)
|
||||
{
|
||||
Vector<FrameDescription> frames(cx);
|
||||
|
||||
for (NonBuiltinScriptFrameIter i(cx); !i.done(); ++i) {
|
||||
NonBuiltinScriptFrameIter i(cx, ScriptFrameIter::ALL_CONTEXTS,
|
||||
ScriptFrameIter::GO_THROUGH_SAVED,
|
||||
cx->compartment()->principals);
|
||||
for ( ; !i.done(); ++i) {
|
||||
if (!frames.append(i))
|
||||
return nullptr;
|
||||
if (frames.length() == maxFrames)
|
||||
|
@ -26,6 +26,15 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=960820
|
||||
ok(/clickCallback/.test(stack), "clickCallback should be in the stack");
|
||||
ok(!/clickHandler/.test(stack), "clickHandler should not be in the stack");
|
||||
ok(/dispatchClick/.test(stack), "dispatchClick should be in the stack");
|
||||
|
||||
// Check Components.stack, but first filter through the SpecialPowers junk.
|
||||
var stack = SpecialPowers.wrap(SpecialPowers.Components).stack;
|
||||
while (/specialpowers/.test(stack)) {
|
||||
stack = stack.caller;
|
||||
}
|
||||
ok(/clickCallback/.test(stack), "clickCallback should be reachable via Components.stack");
|
||||
ok(/clickHandler/.test(stack.caller), "clickHandler should be reachable via Components.stack");
|
||||
ok(/dispatchClick/.test(stack.caller.caller), "dispatchClick hould be reachable via Components.stack");
|
||||
}
|
||||
function dispatchClick() {
|
||||
document.dispatchEvent(new MouseEvent('click'));
|
||||
|
Loading…
Reference in New Issue
Block a user