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

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

Issue 1656993002: [parser] report invalid rest parameter errors in Arrow functions (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: group tests/remove unneeded stuff Created 4 years, 11 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/parsing/parser-base.h ('k') | test/message/arrow-invalid-rest.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 bc12153729c622cf8ad031f2ae486a679949368a..44acc1c37ea53ac3deee958cd06af960c6984eff 100644
--- a/test/cctest/test-parsing.cc
+++ b/test/cctest/test-parsing.cc
@@ -3712,6 +3712,8 @@ TEST(ErrorsArrowFormalParameters) {
TEST(ErrorsArrowFunctions) {
// Tests that parser and preparser generate the same kind of errors
// on invalid arrow function syntax.
+
+ // clang-format off
const char* context_data[][2] = {
{"", ";"},
{"v = ", ";"},
@@ -3812,8 +3814,14 @@ TEST(ErrorsArrowFunctions) {
"(c, a.b) => {}",
"(a['b'], c) => {}",
"(c, a['b']) => {}",
+
+ // crbug.com/582626
+ "(...rest - a) => b",
+ "(a, ...b - 10) => b",
+
NULL
};
+ // clang-format on
// The test is quite slow, so run it with a reduced set of flags.
static const ParserFlag flags[] = {kAllowLazy};
@@ -7976,9 +7984,20 @@ TEST(EscapedKeywords) {
TEST(MiscSyntaxErrors) {
+ // clang-format off
const char* context_data[][2] = {
- {"'use strict'", ""}, {"", ""}, {NULL, NULL}};
- const char* error_data[] = {"for (();;) {}", NULL};
+ { "'use strict'", "" },
+ { "", "" },
+ { NULL, NULL }
+ };
+ const char* error_data[] = {
+ "for (();;) {}",
+
+ // crbug.com/582626
+ "{ NaN ,chA((evarA=new t ( l = !.0[((... co -a0([1]))=> greturnkf",
+ NULL
+ };
+ // clang-format on
RunParserSyncTest(context_data, error_data, kError, NULL, 0, NULL, 0);
}
« no previous file with comments | « src/parsing/parser-base.h ('k') | test/message/arrow-invalid-rest.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698