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: --harmony-scoping | 5 // Flags: |
rossberg
2015/03/13 14:24:33
Dito
Dmitry Lomov (no reviews)
2015/03/13 14:51:29
Done.
| |
6 | 6 |
7 'use strict'; | 7 'use strict'; |
8 | 8 |
9 // Top-level code | 9 // Top-level code |
10 let s = 0; | 10 let s = 0; |
11 let f = [undefined, undefined, undefined] | 11 let f = [undefined, undefined, undefined] |
12 for (const x of [1,2,3]) { | 12 for (const x of [1,2,3]) { |
13 s += x; | 13 s += x; |
14 f[x-1] = function() { return x; } | 14 f[x-1] = function() { return x; } |
15 } | 15 } |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
69 s += q; | 69 s += q; |
70 } | 70 } |
71 assertEquals(6, s); | 71 assertEquals(6, s); |
72 | 72 |
73 s = ""; | 73 s = ""; |
74 for (const x in [1,2,3]) { | 74 for (const x in [1,2,3]) { |
75 s += x; | 75 s += x; |
76 } | 76 } |
77 assertEquals("012", s); | 77 assertEquals("012", s); |
78 }()); | 78 }()); |
OLD | NEW |