Index: test/cctest/test-parsing.cc |
diff --git a/test/cctest/test-parsing.cc b/test/cctest/test-parsing.cc |
index 9768e30a55a6eac19f666e03f98a8a4c65f77d8d..d79f59464741121a09b086b8f2ebc5abccb8bb61 100644 |
--- a/test/cctest/test-parsing.cc |
+++ b/test/cctest/test-parsing.cc |
@@ -1831,3 +1831,46 @@ TEST(NoErrorsParenthesizedDirectivePrologue) { |
RunParserSyncTest(context_data, statement_data, kSuccess); |
} |
+ |
+ |
+TEST(ErrorsNotAnIdentifierName) { |
+ const char* context_data[][2] = { |
+ { "", ""}, |
+ { "\"use strict\";", ""}, |
+ { NULL, NULL } |
+ }; |
+ |
+ const char* statement_data[] = { |
+ "var foo = {}; foo.{;", |
+ "var foo = {}; foo.};", |
+ "var foo = {}; foo.=;", |
+ "var foo = {}; foo.888;", |
+ "var foo = {}; foo.-;", |
+ "var foo = {}; foo.--;", |
+ NULL |
+ }; |
+ |
+ RunParserSyncTest(context_data, statement_data, kError); |
+} |
+ |
+ |
+TEST(NoErrorsIdentifierNames) { |
+ // Keywords etc. are valid as property names. |
+ const char* context_data[][2] = { |
+ { "", ""}, |
+ { "\"use strict\";", ""}, |
+ { NULL, NULL } |
+ }; |
+ |
+ const char* statement_data[] = { |
+ "var foo = {}; foo.if;", |
+ "var foo = {}; foo.yield;", |
+ "var foo = {}; foo.super;", |
+ "var foo = {}; foo.interface;", |
+ "var foo = {}; foo.eval;", |
+ "var foo = {}; foo.arguments;", |
+ NULL |
+ }; |
+ |
+ RunParserSyncTest(context_data, statement_data, kSuccess); |
+} |