Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
1 // Error().stack (ScriptFrameIter) is no longer context-bound.
2 function beta() {
3 evaluate("function gamma() {\nstack = Error().stack;\n };\n gamma();", {newContext: true});
4 }
5 function alpha() {
6 beta();
7 }
8 alpha();
9 assertEq(/alpha@/.test(stack), true);
10 assertEq(/beta@/.test(stack), true);
11 assertEq(/gamma@/.test(stack), true);
12 assertEq(/delta@/.test(stack), false);
14 function delta() {
15 evaluate("stack = Error().stack", {newContext: true});
16 }
17 delta();
18 assertEq(/alpha@/.test(stack), false);
19 assertEq(/beta@/.test(stack), false);
20 assertEq(/gamma@/.test(stack), false);
21 assertEq(/delta@/.test(stack), true);