blob: 2a3b903f9ee63d8b8fa8251bce8d7347fed16c91 [file] [log] [blame]
Ben Murdoch4a90d5f2016-03-22 12:00:34 +00001// 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: --min-preparse-length=0
Ben Murdoch4a90d5f2016-03-22 12:00:34 +00006
7let xxx = 1;
8let f = undefined;
9{
10 let inner_x = xxx;
11 f = function() { return inner_x; };
12}
13
14assertSame(1, f());
15
16xxx = 42;
17{
18 f = function() { return inner_x1; };
19 let inner_x1 = xxx;
20}
21
22assertSame(42, f());
23
24xxx = 31;
25{
26 let inner_x1 = xxx;
27 try {
28 throw new Error();
29 } catch (e) {
30 f = function() { return inner_x1; };
31 }
32}
33assertSame(31, f());