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

Unified Diff: test/cctest/test-parsing.cc

Issue 7215015: Version 3.4.5.1. (Closed) Base URL: http://v8.googlecode.com/svn/trunk/
Patch Set: Created 9 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/version.cc ('k') | test/mjsunit/arguments.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-parsing.cc
===================================================================
--- test/cctest/test-parsing.cc (revision 8352)
+++ test/cctest/test-parsing.cc (working copy)
@@ -137,8 +137,9 @@
// Regression test. See:
// http://code.google.com/p/chromium/issues/detail?id=53548
// Tests that --> is correctly interpreted as comment-to-end-of-line if there
- // is only whitespace before it on the line, even after a multiline-comment
- // comment. This was not the case if it occurred before the first real token
+ // is only whitespace before it on the line (with comments considered as
+ // whitespace, even a multiline-comment containing a newline).
+ // This was not the case if it occurred before the first real token
// in the input.
const char* tests[] = {
// Before first real token.
@@ -152,6 +153,16 @@
NULL
};
+ const char* fail_tests[] = {
+ "x --> is eol-comment\nvar y = 37;\n",
+ "\"\\n\" --> is eol-comment\nvar y = 37;\n",
+ "x/* precomment */ --> is eol-comment\nvar y = 37;\n",
+ "x/* precomment\n */ --> is eol-comment\nvar y = 37;\n",
+ "var x = 42; --> is eol-comment\nvar y = 37;\n",
+ "var x = 42; /* precomment\n */ --> is eol-comment\nvar y = 37;\n",
+ NULL
+ };
+
// Parser/Scanner needs a stack limit.
int marker;
i::Isolate::Current()->stack_guard()->SetStackLimit(
@@ -163,6 +174,13 @@
CHECK(data != NULL && !data->HasError());
delete data;
}
+
+ for (int i = 0; fail_tests[i]; i++) {
+ v8::ScriptData* data =
+ v8::ScriptData::PreCompile(fail_tests[i], i::StrLength(fail_tests[i]));
+ CHECK(data == NULL || data->HasError());
+ delete data;
+ }
}
« no previous file with comments | « src/version.cc ('k') | test/mjsunit/arguments.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698