OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Flags: --harmony-sloppy --harmony-sloppy-let | |
6 | |
7 // See: http://code.google.com/p/v8/issues/detail?id=3926 | 5 // See: http://code.google.com/p/v8/issues/detail?id=3926 |
8 | 6 |
9 // Switch statements should disable hole check elimination | 7 // Switch statements should disable hole check elimination |
10 | 8 |
11 // Ensure that both reads and writes encounter the hole check | 9 // Ensure that both reads and writes encounter the hole check |
12 // FullCodeGen had an issue on reads; TurboFan had an issue on writes | 10 // FullCodeGen had an issue on reads; TurboFan had an issue on writes |
13 function f(x) { | 11 function f(x) { |
14 var z; | 12 var z; |
15 switch (x) { | 13 switch (x) { |
16 case 1: | 14 case 1: |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 case 5: | 76 case 5: |
79 return eval("z"); | 77 return eval("z"); |
80 } | 78 } |
81 } | 79 } |
82 | 80 |
83 assertEquals(undefined, h(1)()); | 81 assertEquals(undefined, h(1)()); |
84 assertThrows(h(2), ReferenceError); | 82 assertThrows(h(2), ReferenceError); |
85 assertThrows(h(3), ReferenceError); | 83 assertThrows(h(3), ReferenceError); |
86 assertThrows(function () {h(4)}, ReferenceError); | 84 assertThrows(function () {h(4)}, ReferenceError); |
87 assertThrows(function () {h(5)}, ReferenceError); | 85 assertThrows(function () {h(5)}, ReferenceError); |
OLD | NEW |