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); |