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

Unified Diff: src/ast/scopes.cc

Issue 1901413002: [debugger] Hide scopes that originate from desugaring. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix crash Created 4 years, 8 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/ast/scopes.h ('k') | src/debug/debug-scopes.cc » ('j') | 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 5d4b80987607b531c423a35c04cdec582a870371..c82ec698d210889b666913b42c7e3c6a619797cc 100644
--- a/src/ast/scopes.cc
+++ b/src/ast/scopes.cc
@@ -193,6 +193,7 @@ void Scope::SetDefaults(ScopeType scope_type, Scope* outer_scope,
scope_info_ = scope_info;
start_position_ = RelocInfo::kNoPosition;
end_position_ = RelocInfo::kNoPosition;
+ is_hidden_ = false;
if (!scope_info.is_null()) {
scope_calls_eval_ = scope_info->CallsEval();
language_mode_ = scope_info->language_mode();
@@ -287,6 +288,7 @@ bool Scope::Analyze(ParseInfo* info) {
: FLAG_print_scopes) {
scope->Print();
}
+ scope->CheckScopePositions();
#endif
info->set_scope(scope);
@@ -1007,6 +1009,16 @@ void Scope::Print(int n) {
Indent(n0, "}\n");
}
+
+void Scope::CheckScopePositions() {
+ // A scope is allowed to have invalid positions if it is hidden and has no
+ // inner scopes
+ if (!is_hidden() && inner_scopes_.length() == 0) {
+ CHECK_NE(RelocInfo::kNoPosition, start_position());
+ CHECK_NE(RelocInfo::kNoPosition, end_position());
+ }
+ for (Scope* scope : inner_scopes_) scope->CheckScopePositions();
+}
#endif // DEBUG
« no previous file with comments | « src/ast/scopes.h ('k') | src/debug/debug-scopes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698