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

Unified Diff: test/mjsunit/harmony/async-await-basic.js

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 | « test/cctest/test-parsing.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/harmony/async-await-basic.js
diff --git a/test/mjsunit/harmony/async-await-basic.js b/test/mjsunit/harmony/async-await-basic.js
index 40a2605177aee33d97c57f72a6cc31907a920ee5..35bcb109ed3e45cab3bf11ab88d967305f4a6058 100644
--- a/test/mjsunit/harmony/async-await-basic.js
+++ b/test/mjsunit/harmony/async-await-basic.js
@@ -343,8 +343,20 @@ assertEquals("async function () {}", async function() {}.toString());
assertEquals("async x => x", (async x => x).toString());
assertEquals("async x => { return x }", (async x => { return x }).toString());
class AsyncMethod { async foo() { } }
-assertEquals("async foo() { }", Function.prototype.toString.call(AsyncMethod.prototype.foo));
-assertEquals("async foo() { }", Function.prototype.toString.call({async foo() { }}.foo));
+assertEquals("async foo() { }",
+ Function.prototype.toString.call(AsyncMethod.prototype.foo));
+assertEquals("async foo() { }",
+ Function.prototype.toString.call({async foo() { }}.foo));
// Async functions are not constructible
assertThrows(() => class extends (async function() {}) {}, TypeError);
+
+// Regress v8:5148
+assertEqualsAsync("1", () => (async({ a = NaN }) => a)({ a: "1" }));
+assertEqualsAsync(
+ "10", () => (async(foo, { a = NaN }) => foo + a)("1", { a: "0" }));
+assertEqualsAsync("2", () => (async({ a = "2" }) => a)({ a: undefined }));
+assertEqualsAsync(
+ "20", () => (async(foo, { a = "0" }) => foo + a)("2", { a: undefined }));
+assertThrows(() => eval("async({ foo = 1 })"), SyntaxError);
+assertThrows(() => eval("async(a, { foo = 1 })"), SyntaxError);
« no previous file with comments | « test/cctest/test-parsing.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698