sbarati@apple.com | 78e87c7 | 2017-02-11 04:05:06 +0000 | [diff] [blame] | 1 | function e() { } |
| 2 | noInline(e); |
| 3 | |
| 4 | function foo(b, c, d) { |
| 5 | let x; |
| 6 | function bar() { return x; } |
| 7 | if (b) { |
| 8 | let y = function() { return x; } |
| 9 | } else { |
| 10 | let y = function() { return x; } |
| 11 | } |
| 12 | |
| 13 | if (c) { |
| 14 | function baz() { } |
| 15 | if (b) { |
| 16 | let y = function() { return x; } |
| 17 | e(y); |
| 18 | } else { |
| 19 | let y = function() { return x; } |
| 20 | e(y); |
| 21 | } |
| 22 | if (d) |
| 23 | d(); |
| 24 | e(baz); |
| 25 | } |
| 26 | |
| 27 | } |
| 28 | noInline(foo); |
| 29 | |
| 30 | for (let i = 0; i < 100000; i++) { |
| 31 | foo(!!(i % 2), true, false); |
| 32 | } |
| 33 | |
| 34 | let threw = false; |
| 35 | try { |
| 36 | foo(true, true, true); |
| 37 | } catch(e) { |
| 38 | threw = true; |
| 39 | } |
| 40 | if (!threw) |
| 41 | throw new Error("Bad test") |