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

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

Issue 2300503002: Refactor object/class literal property name parsing (Closed)
Patch Set: fix & more tests Created 4 years, 4 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
« src/parsing/parser-base.h ('K') | « src/parsing/preparser.cc ('k') | no next file » | 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 91c5baccc77b868e1e87af1c24c74cba46b569e5..c8c0cab3d4c16044b34a462d6a13bcfb2a91c948 100644
--- a/test/cctest/test-parsing.cc
+++ b/test/cctest/test-parsing.cc
@@ -2912,6 +2912,20 @@ TEST(ErrorsObjectLiteralChecking) {
// Parsing FunctionLiteral for getter or setter fails
"get foo( +",
"get foo() \"error\"",
+ // Various forbidden forms
+ "static x: 0",
+ "static x(){}",
adamk 2016/08/31 17:37:07 Please add some tests with async (you'll have to a
bakkot 2016/08/31 19:46:28 Done.
+ "*x: 0",
+ "*x",
+ "*get x(){}",
+ "*set x(y){}",
+ "get *x(){}",
+ "set *x(y){}",
+ "get x*(){}",
+ "set x*(y){}",
+ "x = 0",
+ "* *x(){}",
+ "x*(){}",
NULL
};
@@ -2968,6 +2982,12 @@ TEST(NoErrorsObjectLiteralChecking) {
"1: 1, set 2(v) {}",
"get: 1, get foo() {}",
"set: 1, set foo(_) {}",
+ // Potentially confusing cases
+ "*get() {}",
+ "*set() {}",
+ "*static() {}",
+ "get : 0",
adamk 2016/08/31 17:37:07 Maybe some positive async tests too?
bakkot 2016/08/31 19:46:28 Done.
+ "set : 0",
// Keywords, future reserved and strict future reserved are also allowed as
// property names.
"if: 4",
« src/parsing/parser-base.h ('K') | « src/parsing/preparser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698