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

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

Issue 899363002: Allow eval and arguments as property names (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Cleanup based on code review Created 5 years, 10 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/preparser.cc ('k') | test/mjsunit/harmony/class-property-name-eval-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
diff --git a/test/cctest/test-parsing.cc b/test/cctest/test-parsing.cc
index 41d8dfe42a6f8bed6266308ea00d42e8ad0abe78..07cf5e61f8d4bf70ceeff53150f4dfb83eeea7e8 100644
--- a/test/cctest/test-parsing.cc
+++ b/test/cctest/test-parsing.cc
@@ -5072,3 +5072,48 @@ TEST(LanguageModeDirectives) {
TestLanguageMode("\"use some future directive\"; \"use strict\";", i::STRICT);
TestLanguageMode("\"use some future directive\"; \"use strong\";", i::STRONG);
}
+
+
+TEST(PropertyNameEvalArguments) {
+ const char* context_data[][2] = {{"'use strict';", ""},
+ {"'use strong';", ""},
+ {NULL, NULL}};
+
+ const char* statement_data[] = {
+ "({eval: 1})",
+ "({arguments: 1})",
+ "({eval() {}})",
+ "({arguments() {}})",
+ "({*eval() {}})",
+ "({*arguments() {}})",
+ "({get eval() {}})",
+ "({get arguments() {}})",
+ "({set eval(_) {}})",
+ "({set arguments(_) {}})",
+
+ "class C {eval() {}}",
+ "class C {arguments() {}}",
+ "class C {*eval() {}}",
+ "class C {*arguments() {}}",
+ "class C {get eval() {}}",
+ "class C {get arguments() {}}",
+ "class C {set eval(_) {}}",
+ "class C {set arguments(_) {}}",
+
+ "class C {static eval() {}}",
+ "class C {static arguments() {}}",
+ "class C {static *eval() {}}",
+ "class C {static *arguments() {}}",
+ "class C {static get eval() {}}",
+ "class C {static get arguments() {}}",
+ "class C {static set eval(_) {}}",
+ "class C {static set arguments(_) {}}",
+
+ NULL};
+
+ static const ParserFlag always_flags[] = {
+ kAllowHarmonyClasses, kAllowHarmonyObjectLiterals, kAllowHarmonyScoping,
+ kAllowStrongMode};
+ RunParserSyncTest(context_data, statement_data, kSuccess, NULL, 0,
+ always_flags, arraysize(always_flags));
+}
« no previous file with comments | « src/preparser.cc ('k') | test/mjsunit/harmony/class-property-name-eval-arguments.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698