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

Unified Diff: src/objects.cc

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 | « no previous file | 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: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index 05a1ab05ccb9fa2c54dbc82f4c6fbe8e4b7ea9db..4824488ce02e3730411a65af3ec5a284c5a1ac10 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -12192,10 +12192,16 @@ Handle<String> JSFunction::ToString(Handle<JSFunction> function) {
IncrementalStringBuilder builder(isolate);
if (!shared_info->is_arrow()) {
if (shared_info->is_concise_method()) {
- if (shared_info->is_generator()) builder.AppendCharacter('*');
+ if (shared_info->is_generator()) {
+ builder.AppendCharacter('*');
+ } else if (shared_info->is_async()) {
+ builder.AppendCString("async ");
+ }
} else {
if (shared_info->is_generator()) {
builder.AppendCString("function* ");
+ } else if (shared_info->is_async()) {
+ builder.AppendCString("async function ");
} else {
builder.AppendCString("function ");
}
« no previous file with comments | « no previous file | test/mjsunit/harmony/async-await-basic.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698