Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(347)

Unified Diff: test/mjsunit/harmony/block-scoping-top-level.js

Issue 981203003: Stack allocate lexical locals + hoist stack slots (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: More cleanup Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: test/mjsunit/harmony/block-scoping-top-level.js
diff --git a/test/mjsunit/harmony/block-scoping-top-level.js b/test/mjsunit/harmony/block-scoping-top-level.js
new file mode 100644
index 0000000000000000000000000000000000000000..9e45b091575d19270d35ebd72bac570f8588611e
--- /dev/null
+++ b/test/mjsunit/harmony/block-scoping-top-level.js
@@ -0,0 +1,23 @@
+// Copyright 2012 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flags: --harmony-scoping
+'use strict';
+
+let xxx = 1;
+let f = undefined;
+{
+ let inner_x = xxx;
+ f = function() { return inner_x; };
+}
+
+assertSame(1, f());
+
+xxx = 42;
+{
+ f = function() { return inner_x1; };
+ let inner_x1 = xxx;
+}
+
+assertSame(42, f());

Powered by Google App Engine
This is Rietveld 408576698