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

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

Issue 1973193002: [esnext] Async function toString support (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@async-run3
Patch Set: style Created 4 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/objects.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 9c8af3c85e388ba64d9e81c28ca3ec85aa3348bb..d0888eaf33ffca6869152e1f4444188a55f61b7f 100644
--- a/test/mjsunit/harmony/async-await-basic.js
+++ b/test/mjsunit/harmony/async-await-basic.js
@@ -336,3 +336,12 @@ var resumeAfterThrowNewEval = new AsyncFunction("value", `
log = [];
assertEqualsAsync(6, () => resumeAfterThrowNewEval(5));
assertEquals("start:5 resume:throw1 resume:throw2", log.join(" "));
+
+async function foo() {}
+assertEquals("async function foo() {}", foo.toString());
+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));
« no previous file with comments | « src/objects.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698