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 --harmony-destructuring-bind | 5 // Flags: --harmony-sloppy --harmony-sloppy-let --legacy-const |
6 // Flags: --legacy-const | |
7 | 6 |
8 // let is usable as a variable with var or legacy const, not let or ES6 const | 7 // let is usable as a variable with var or legacy const, not let or ES6 const |
9 | 8 |
10 (function (){ | 9 (function (){ |
11 assertEquals(undefined, let); | 10 assertEquals(undefined, let); |
12 | 11 |
13 var let; | 12 var let; |
14 | 13 |
15 let = 5; | 14 let = 5; |
16 assertEquals(5, let); | 15 assertEquals(5, let); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 })(); | 57 })(); |
59 | 58 |
60 (function() { | 59 (function() { |
61 function let() { | 60 function let() { |
62 return 1; | 61 return 1; |
63 } | 62 } |
64 assertEquals(1, let()); | 63 assertEquals(1, let()); |
65 })() | 64 })() |
66 | 65 |
67 assertThrows('for (let of []) {}', SyntaxError); | 66 assertThrows('for (let of []) {}', SyntaxError); |
OLD | NEW |