|
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); |
|
13 |
|
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); |