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