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

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

Issue 2091313002: [parser] don't report error for CoverInitializedNames in async arrow formals (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: _Really_ fix compile error Created 4 years, 6 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/mjsunit/harmony/async-await-basic.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 3c7822a03209f55c7888e27c05e2cdf1622b8f6c..79df9b14c3fe5d5fe49ed22636737a593607c2ca 100644
--- a/test/cctest/test-parsing.cc
+++ b/test/cctest/test-parsing.cc
@@ -7504,6 +7504,9 @@ TEST(AsyncAwait) {
"var O = { async 'method'() { await 1; } }",
"var O = { async 0() { await 1; } }",
"async function await() {}",
+
+ "var asyncFn = async({ foo = 1 }) => foo;",
+ "var asyncFn = async({ foo = 1 } = {}) => foo;",
NULL
};
// clang-format on
@@ -7665,6 +7668,10 @@ TEST(AsyncAwaitErrors) {
"(async`foo`.bar => 1)",
"(async`foo`.bar foo => 1)",
"(async`foo`.bar () => 1)",
+
+ // v8:5148 assert that errors are still thrown for calls that may have been
+ // async functions
+ "async({ foo = 1 })",
NULL
};
@@ -7686,6 +7693,22 @@ TEST(AsyncAwaitErrors) {
NULL
};
+
+ const char* formal_parameters_data[] = {
+ "var f = async({ await }) => 1;",
+ "var f = async({ await = 1 }) => 1;",
+ "var f = async({ await } = {}) => 1;",
+ "var f = async({ await = 1 } = {}) => 1;",
+ "var f = async([await]) => 1;",
+ "var f = async([await] = []) => 1;",
+ "var f = async([await = 1]) => 1;",
+ "var f = async([await = 1] = []) => 1;",
+ "var f = async(...await) => 1;",
+ "var f = async(await) => 1;",
+ "var f = async(await = 1) => 1;",
+ "var f = async(...[await]) => 1;",
+ NULL
+ };
// clang-format on
static const ParserFlag always_flags[] = {kAllowHarmonyAsyncAwait};
@@ -7693,6 +7716,17 @@ TEST(AsyncAwaitErrors) {
arraysize(always_flags));
RunParserSyncTest(strict_context_data, strict_error_data, kError, NULL, 0,
always_flags, arraysize(always_flags));
+ {
+ // TODO(caitp): support these early errors in preparser
+ USE(formal_parameters_data);
+ // const bool kIsModule = false;
+ // const bool kTestPreparser = false;
+ // TODO(caitp): These tests seem to fail test-parsing.cc, even with
+ // test_preparser disabled.
+ // RunParserSyncTest(context_data, formal_parameters_data, kError, NULL, 0,
+ // always_flags, arraysize(always_flags), NULL, 0,
+ // kIsModule, kTestPreparser);
+ }
}
TEST(AsyncAwaitModule) {
« no previous file with comments | « src/parsing/parser-base.h ('k') | test/mjsunit/harmony/async-await-basic.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698