OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 // Flags: --harmony-do-expressions --nolazy |
| 6 |
| 7 function hoist_unique_do_var() { |
| 8 var f = (y = do { var unique = 3 }) => unique; |
| 9 assertEquals(3, f()); |
| 10 assertThrows(() => unique, ReferenceError); |
| 11 } |
| 12 hoist_unique_do_var(); |
| 13 |
| 14 function hoist_duplicate_do_var() { |
| 15 var duplicate = 100; |
| 16 var f = (y = do { var duplicate = 3 }) => duplicate; |
| 17 assertEquals(3, f()); |
| 18 // TODO(verwaest): The {duplicate} declarations were invalidly merged. |
| 19 assertEquals(3, duplicate); |
| 20 } |
| 21 hoist_duplicate_do_var(); |
OLD | NEW |