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

Unified Diff: test/mjsunit/regress/regress-crbug-135066.js

Issue 10704058: Fix lazy compilation for strict eval scopes. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 6 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/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-crbug-135066.js
diff --git a/test/mjsunit/regress/regress-crbug-135008.js b/test/mjsunit/regress/regress-crbug-135066.js
similarity index 82%
copy from test/mjsunit/regress/regress-crbug-135008.js
copy to test/mjsunit/regress/regress-crbug-135066.js
index 2be396e8055a916b1f7c7370ff32ff0d40eea762..1aeca8b1a32d678ba7274c60230a77fdda97f6aa 100644
--- a/test/mjsunit/regress/regress-crbug-135008.js
+++ b/test/mjsunit/regress/regress-crbug-135066.js
@@ -28,18 +28,26 @@
// Filler long enough to trigger lazy parsing.
var filler = "//" + new Array(1024).join('x');
-var scope = { x:23 };
+// Test strict eval in global context.
+eval(
+ "'use strict';" +
+ "var x = 23;" +
+ "var f = function bozo1() {" +
+ " return x;" +
+ "};" +
+ "assertSame(23, f());" +
+ filler
+);
-with(scope) {
+// Test default eval in strict context.
+(function() {
+ "use strict";
eval(
- "scope.f = (function outer() {" +
- " function inner() {" +
- " return x;" +
- " }" +
- " return inner;" +
- "})();" +
+ "var y = 42;" +
+ "var g = function bozo2() {" +
+ " return y;" +
+ "};" +
+ "assertSame(42, g());" +
filler
);
-};
-
-assertSame(23, scope.f());
+})();
« no previous file with comments | « src/scopes.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698