OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 // Flags: --harmony-sloppy-let --harmony-sloppy |
| 6 |
| 7 // Test that hoisting a function out of a lexical scope does not |
| 8 // lead to a parsing error |
| 9 |
| 10 // This used to cause a crash in the parser |
| 11 function f(one) { class x { } { class x { } function g() { one; x; } g() } } f() |
| 12 |
| 13 // This used to lead to a ReferenceError |
| 14 function g() { var x = 1; { let x = 2; function g() { x; } g(); } } |
| 15 assertEquals(undefined, g()); |
| 16 |
| 17 // This used to cause a crash in the parser |
| 18 function __f_4(one) { |
| 19 var __v_10 = one + 1; |
| 20 { |
| 21 let __v_10 = one + 3; |
| 22 function __f_6() { |
| 23 one; |
| 24 __v_10; |
| 25 } |
| 26 __f_6(); |
| 27 } |
| 28 } |
| 29 __f_4(); |
OLD | NEW |