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

Side by Side Diff: src/scopes.cc

Issue 1398603002: In Scope::Print, skip null scope_names_ just like empty ones (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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/scopes.h" 5 #include "src/scopes.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/bootstrapper.h" 8 #include "src/bootstrapper.h"
9 #include "src/messages.h" 9 #include "src/messages.h"
10 #include "src/parser.h" 10 #include "src/parser.h"
(...skipping 920 matching lines...) Expand 10 before | Expand all | Expand 10 after
931 } 931 }
932 } 932 }
933 933
934 934
935 void Scope::Print(int n) { 935 void Scope::Print(int n) {
936 int n0 = (n > 0 ? n : 0); 936 int n0 = (n > 0 ? n : 0);
937 int n1 = n0 + 2; // indentation 937 int n1 = n0 + 2; // indentation
938 938
939 // Print header. 939 // Print header.
940 Indent(n0, Header(scope_type_, function_kind_, is_declaration_scope())); 940 Indent(n0, Header(scope_type_, function_kind_, is_declaration_scope()));
941 if (!scope_name_->IsEmpty()) { 941 if (scope_name_ != nullptr && !scope_name_->IsEmpty()) {
942 PrintF(" "); 942 PrintF(" ");
943 PrintName(scope_name_); 943 PrintName(scope_name_);
944 } 944 }
945 945
946 // Print parameters, if any. 946 // Print parameters, if any.
947 if (is_function_scope()) { 947 if (is_function_scope()) {
948 PrintF(" ("); 948 PrintF(" (");
949 for (int i = 0; i < params_.length(); i++) { 949 for (int i = 0; i < params_.length(); i++) {
950 if (i > 0) PrintF(", "); 950 if (i > 0) PrintF(", ");
951 const AstRawString* name = params_[i]->raw_name(); 951 const AstRawString* name = params_[i]->raw_name();
(...skipping 695 matching lines...) Expand 10 before | Expand all | Expand 10 after
1647 function_ != NULL && function_->proxy()->var()->IsContextSlot(); 1647 function_ != NULL && function_->proxy()->var()->IsContextSlot();
1648 return num_heap_slots() - Context::MIN_CONTEXT_SLOTS - num_global_slots() - 1648 return num_heap_slots() - Context::MIN_CONTEXT_SLOTS - num_global_slots() -
1649 (is_function_var_in_context ? 1 : 0); 1649 (is_function_var_in_context ? 1 : 0);
1650 } 1650 }
1651 1651
1652 1652
1653 int Scope::ContextGlobalCount() const { return num_global_slots(); } 1653 int Scope::ContextGlobalCount() const { return num_global_slots(); }
1654 1654
1655 } // namespace internal 1655 } // namespace internal
1656 } // namespace v8 1656 } // namespace v8
OLDNEW
« 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