Index: test/cctest/test-parsing.cc |
diff --git a/test/cctest/test-parsing.cc b/test/cctest/test-parsing.cc |
index 08f117b3513c7657b6dabc4b7a7e26c6d4a2b2f5..2b707fcc70a475c3170ca1cd4f8183968c0101f7 100755 |
--- a/test/cctest/test-parsing.cc |
+++ b/test/cctest/test-parsing.cc |
@@ -137,8 +137,9 @@ TEST(ScanHTMLEndComments) { |
// 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 @@ TEST(ScanHTMLEndComments) { |
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 @@ TEST(ScanHTMLEndComments) { |
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; |
+ } |
} |