| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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: --legacy-const |
| 6 |
| 5 (function f(){ | 7 (function f(){ |
| 6 assertEquals("function", typeof f); | 8 assertEquals("function", typeof f); |
| 7 })(); | 9 })(); |
| 8 | 10 |
| 9 (function f(){ | 11 (function f(){ |
| 10 var f; // Variable shadows function name. | 12 var f; // Variable shadows function name. |
| 11 assertEquals("undefined", typeof f); | 13 assertEquals("undefined", typeof f); |
| 12 })(); | 14 })(); |
| 13 | 15 |
| 14 (function f(){ | 16 (function f(){ |
| (...skipping 16 matching lines...) Expand all Loading... |
| 31 | 33 |
| 32 // const initialization is not intercepted by with scope. | 34 // const initialization is not intercepted by with scope. |
| 33 (function() { | 35 (function() { |
| 34 var o = { a: 1 }; | 36 var o = { a: 1 }; |
| 35 with (o) { | 37 with (o) { |
| 36 const a = 2; | 38 const a = 2; |
| 37 } | 39 } |
| 38 assertEquals(2, a); | 40 assertEquals(2, a); |
| 39 assertEquals(1, o.a); | 41 assertEquals(1, o.a); |
| 40 })(); | 42 })(); |
| OLD | NEW |