mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1034477 - Save stacks that cross contexts in js::SavedStacks. r=shu
This commit is contained in:
parent
195262fa39
commit
db16b5400a
24
js/src/jit-test/tests/saved-stacks/new-context.js
Normal file
24
js/src/jit-test/tests/saved-stacks/new-context.js
Normal file
@ -0,0 +1,24 @@
|
||||
// Test that we can save stacks that cross contexts.
|
||||
|
||||
const stack = (function iife() {
|
||||
return evaluate("(" + function evalFrame() {
|
||||
return saveStack();
|
||||
} + "())", {
|
||||
newContext: true,
|
||||
fileName: "evaluated"
|
||||
});
|
||||
}());
|
||||
|
||||
print(stack);
|
||||
|
||||
assertEq(stack.functionDisplayName, "evalFrame");
|
||||
assertEq(stack.source, "evaluated");
|
||||
|
||||
assertEq(stack.parent.source, "evaluated");
|
||||
|
||||
assertEq(stack.parent.parent.functionDisplayName, "iife");
|
||||
assertEq(/new-context\.js$/.test(stack.parent.parent.source), true);
|
||||
|
||||
assertEq(/new-context\.js$/.test(stack.parent.parent.parent.source), true);
|
||||
|
||||
assertEq(stack.parent.parent.parent.parent, null);
|
@ -401,7 +401,7 @@ SavedStacks::saveCurrentStack(JSContext *cx, MutableHandleSavedFrame frame, unsi
|
||||
JS_ASSERT(initialized());
|
||||
JS_ASSERT(&cx->compartment()->savedStacks() == this);
|
||||
|
||||
FrameIter iter(cx);
|
||||
FrameIter iter(cx, FrameIter::ALL_CONTEXTS, FrameIter::GO_THROUGH_SAVED);
|
||||
return insertFrames(cx, iter, frame, maxFrameCount);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user