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

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

Issue 1141223002: [parser] report SyntaxError if rest parameter used in Setter MethodDefinition (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add cctest Created 5 years, 7 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/message/rest-param-class-setter-strict.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 2f96ec45f0c908c5e4718fb3782d6e5a77774c2a..afe638d54e1d011c923023b91a0e9c4811ea8ba0 100644
--- a/test/cctest/test-parsing.cc
+++ b/test/cctest/test-parsing.cc
@@ -5109,6 +5109,24 @@ TEST(ParseRestParametersErrors) {
}
+TEST(RestParameterInSetterMethodError) {
+ const char* context_data[][2] = {
+ {"'use strict';({ set prop(", ") {} }).prop = 1;"},
+ {"'use strict';(class { static set prop(", ") {} }).prop = 1;"},
+ {"'use strict';(new (class { set prop(", ") {} })).prop = 1;"},
+ {"({ set prop(", ") {} }).prop = 1;"},
+ {"(class { static set prop(", ") {} }).prop = 1;"},
+ {"(new (class { set prop(", ") {} })).prop = 1;"},
+ {nullptr, nullptr}};
+ const char* data[] = {"...a", "...arguments", "...eval", nullptr};
+
+ static const ParserFlag always_flags[] = {
+ kAllowHarmonyRestParameters, kAllowHarmonyClasses, kAllowHarmonySloppy};
+ RunParserSyncTest(context_data, data, kError, nullptr, 0, always_flags,
+ arraysize(always_flags));
+}
+
+
TEST(RestParametersEvalArguments) {
const char* strict_context_data[][2] =
{{"'use strict';(function(",
« no previous file with comments | « src/preparser.cc ('k') | test/message/rest-param-class-setter-strict.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698