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

Unified Diff: test/mjsunit/regress/regress-5736.js

Issue 2583163002: Force ctxt allocation in eval scopes. (Closed)
Patch Set: moar Created 3 years, 12 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
« no previous file with comments | « src/ast/scopes.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/regress/regress-5736.js
diff --git a/test/mjsunit/regress/regress-5736.js b/test/mjsunit/regress/regress-5736.js
index cf934cc9080c356c61664b18fa36b288420583bd..6583da38da85e8977b51921b0a2734348eeb1bd0 100644
--- a/test/mjsunit/regress/regress-5736.js
+++ b/test/mjsunit/regress/regress-5736.js
@@ -24,3 +24,11 @@ assertEquals(2, my_global);
eval("let foo = 1; function lazy() { foo = 2; } lazy(); my_global = foo;");
assertEquals(my_global, 2);
+
+// Lexical variable inside a subscope in eval.
+eval(`{ let foo = 5;
+ function not_lazy() { foo = 6; }
+ not_lazy();
+ my_global = foo;
+ }`);
+assertEquals(my_global, 6);
« no previous file with comments | « src/ast/scopes.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698