]>
Commit | Line | Data |
---|---|---|
ed1e77d3 A |
1 | function direct() { |
2 | return arguments; | |
3 | } | |
4 | ||
5 | function scoped(a) { | |
6 | if (!effectful42()) | |
7 | return function() { return a; } | |
8 | return arguments; | |
9 | } | |
10 | ||
11 | function foo(a) { | |
12 | try { | |
13 | return a[0]; | |
14 | } catch (e) { | |
15 | return -23; | |
16 | } | |
17 | } | |
18 | ||
19 | for (var i = 0; i < 100; ++i) { | |
20 | var result = foo(scoped(42)); | |
21 | if (result != 42) | |
22 | throw "Error: bad result: " + result; | |
23 | } | |
24 | ||
25 | for (var i = 0; i < 100; ++i) { | |
26 | var result = foo(direct(42)); | |
27 | if (result != 42) | |
28 | throw "Error: bad result: " + result; | |
29 | } | |
30 |