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: --min-preparse-length=0 | |
6 | |
7 let xxx = 1; | 5 let xxx = 1; |
8 let f = undefined; | 6 let f = undefined; |
9 { | 7 { |
10 let inner_x = xxx; | 8 let inner_x = xxx; |
11 f = function() { return inner_x; }; | 9 f = function() { return inner_x; }; |
12 } | 10 } |
13 | 11 |
14 assertSame(1, f()); | 12 assertSame(1, f()); |
15 | 13 |
16 xxx = 42; | 14 xxx = 42; |
17 { | 15 { |
18 f = function() { return inner_x1; }; | 16 f = function() { return inner_x1; }; |
19 let inner_x1 = xxx; | 17 let inner_x1 = xxx; |
20 } | 18 } |
21 | 19 |
22 assertSame(42, f()); | 20 assertSame(42, f()); |
23 | 21 |
24 xxx = 31; | 22 xxx = 31; |
25 { | 23 { |
26 let inner_x1 = xxx; | 24 let inner_x1 = xxx; |
27 try { | 25 try { |
28 throw new Error(); | 26 throw new Error(); |
29 } catch (e) { | 27 } catch (e) { |
30 f = function() { return inner_x1; }; | 28 f = function() { return inner_x1; }; |
31 } | 29 } |
32 } | 30 } |
33 assertSame(31, f()); | 31 assertSame(31, f()); |
OLD | NEW |