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

Unified Diff: src/ast/scopes.cc

Issue 2088813002: [ast] Be more precise in --print-scopes about the function kind. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Detect async arrow functions as such 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast/scopes.cc
diff --git a/src/ast/scopes.cc b/src/ast/scopes.cc
index beffa53d74a971a1e39c02e8eb6dd5224b4c21f8..36831d50e2339fb1dee690bfd3e0ed7520bd4638 100644
--- a/src/ast/scopes.cc
+++ b/src/ast/scopes.cc
@@ -838,7 +838,10 @@ static const char* Header(ScopeType scope_type, FunctionKind function_kind,
case EVAL_SCOPE: return "eval";
// TODO(adamk): Should we print concise method scopes specially?
case FUNCTION_SCOPE:
- return IsArrowFunction(function_kind) ? "arrow" : "function";
+ if (IsGeneratorFunction(function_kind)) return "function*";
+ if (IsAsyncFunction(function_kind)) return "async function";
+ if (IsArrowFunction(function_kind)) return "arrow";
+ return "function";
case MODULE_SCOPE: return "module";
case SCRIPT_SCOPE: return "global";
case CATCH_SCOPE: return "catch";
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698