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

Unified Diff: src/scopes.cc

Issue 1386253002: Use Scope::function_kind_ to distinguish arrow function scopes (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 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
Index: src/scopes.cc
diff --git a/src/scopes.cc b/src/scopes.cc
index eb6a0ab6c198b787afe0f60a273df59ff6059438..7d52db85a9faf74df460aade3e557bbcb5818e4a 100644
--- a/src/scopes.cc
+++ b/src/scopes.cc
@@ -844,16 +844,18 @@ void Scope::ReportMessage(int start_position, int end_position,
#ifdef DEBUG
-static const char* Header(ScopeType scope_type, bool is_declaration_scope) {
+static const char* Header(ScopeType scope_type, FunctionKind function_kind,
+ bool is_declaration_scope) {
switch (scope_type) {
case EVAL_SCOPE: return "eval";
- case FUNCTION_SCOPE: return "function";
+ // TODO(adamk): Should we print concise method scopes specially?
+ case FUNCTION_SCOPE:
+ return IsArrowFunction(function_kind) ? "arrow" : "function";
case MODULE_SCOPE: return "module";
case SCRIPT_SCOPE: return "global";
case CATCH_SCOPE: return "catch";
case BLOCK_SCOPE: return is_declaration_scope ? "varblock" : "block";
case WITH_SCOPE: return "with";
- case ARROW_SCOPE: return "arrow";
}
UNREACHABLE();
return NULL;
@@ -935,7 +937,7 @@ void Scope::Print(int n) {
int n1 = n0 + 2; // indentation
// Print header.
- Indent(n0, Header(scope_type_, is_declaration_scope()));
+ Indent(n0, Header(scope_type_, function_kind_, is_declaration_scope()));
if (!scope_name_->IsEmpty()) {
PrintF(" ");
PrintName(scope_name_);

Powered by Google App Engine
This is Rietveld 408576698