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

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

Issue 16549003: Fix crasher when checking for "of", but next token has no literal buffer (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add test suite (thanks Michael) Created 7 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/scanner.h ('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-248025.js
diff --git a/test/mjsunit/regress/regress-crbug-135008.js b/test/mjsunit/regress/regress-crbug-248025.js
similarity index 81%
copy from test/mjsunit/regress/regress-crbug-135008.js
copy to test/mjsunit/regress/regress-crbug-248025.js
index 2be396e8055a916b1f7c7370ff32ff0d40eea762..c5988595663c9622853e98585ed4a4e9bed089b1 100644
--- a/test/mjsunit/regress/regress-crbug-135008.js
+++ b/test/mjsunit/regress/regress-crbug-248025.js
@@ -1,4 +1,4 @@
-// Copyright 2012 the V8 project authors. All rights reserved.
+// Copyright 2013 the V8 project authors. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
@@ -25,21 +25,16 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+// Flags: --harmony-iteration
+
// Filler long enough to trigger lazy parsing.
var filler = "//" + new Array(1024).join('x');
-var scope = { x:23 };
-
-with(scope) {
- eval(
- "scope.f = (function outer() {" +
- " function inner() {" +
- " return x;" +
- " }" +
- " return inner;" +
- "})();" +
- filler
- );
-};
-
-assertSame(23, scope.f());
+// Test that the pre-parser does not crash when the expected contextual
+// keyword as part if a 'for' statement is not and identifier.
+try {
+ eval(filler + "\nfunction f() { for (x : y) { } }");
+ throw "not reached";
+} catch (e) {
+ if (!(e instanceof SyntaxError)) throw e;
+}
« no previous file with comments | « src/scanner.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698