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