| 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-let | |
| 6 | |
| 7 | 5 |
| 8 function assertUndef(x) { | 6 function assertUndef(x) { |
| 9 assertEquals(undefined, x); | 7 assertEquals(undefined, x); |
| 10 } | 8 } |
| 11 | 9 |
| 12 | 10 |
| 13 // IfStatement [13.6.7] | 11 // IfStatement [13.6.7] |
| 14 | 12 |
| 15 assertUndef(eval('42; if (true) ; else 0;')); // ES5: 42 | 13 assertUndef(eval('42; if (true) ; else 0;')); // ES5: 42 |
| 16 assertUndef(eval('42; if (true) ;')); // ES5: 42 | 14 assertUndef(eval('42; if (true) ;')); // ES5: 42 |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 assertUndef(eval("var x = 1;")); | 139 assertUndef(eval("var x = 1;")); |
| 142 assertEquals(1, eval("if (true) { 1; } else { 2; }")); | 140 assertEquals(1, eval("if (true) { 1; } else { 2; }")); |
| 143 assertEquals(2, eval("if (false) { 1; } else { 2; }")); | 141 assertEquals(2, eval("if (false) { 1; } else { 2; }")); |
| 144 assertUndef(eval("try{1; if (true) { 2; throw ''; } else { 2; }} catch(e){}")); | 142 assertUndef(eval("try{1; if (true) { 2; throw ''; } else { 2; }} catch(e){}")); |
| 145 assertEquals(2, eval("1; var i = 0; do { ++i; 2; } while(i!=1);")); | 143 assertEquals(2, eval("1; var i = 0; do { ++i; 2; } while(i!=1);")); |
| 146 assertUndef(eval( | 144 assertUndef(eval( |
| 147 "try{1; var i = 0; do { ++i; 2; throw ''; } while (i!=1);} catch(e){}")); | 145 "try{1; var i = 0; do { ++i; 2; throw ''; } while (i!=1);} catch(e){}")); |
| 148 assertUndef(eval("1; try{2; throwOnReturn();} catch(e){}")); | 146 assertUndef(eval("1; try{2; throwOnReturn();} catch(e){}")); |
| 149 assertUndef(eval("1; twoFunc();")); | 147 assertUndef(eval("1; twoFunc();")); |
| 150 assertEquals(2, eval("1; with ( { a: 0 } ) { 2; }")); | 148 assertEquals(2, eval("1; with ( { a: 0 } ) { 2; }")); |
| OLD | NEW |