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

Unified Diff: src/parsing/parser.cc

Issue 2744213003: [debugger] fix switch block source positions. (Closed)
Patch Set: address comment Created 3 years, 9 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 | src/parsing/parser-base.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parsing/parser.cc
diff --git a/src/parsing/parser.cc b/src/parsing/parser.cc
index 5fade0b3b7dd1ca2ee69995ea0c56d5b5a8ad278..389ec0020204c2ee6b2c45f86df51ce11b4d420b 100644
--- a/src/parsing/parser.cc
+++ b/src/parsing/parser.cc
@@ -1665,6 +1665,10 @@ Statement* Parser::RewriteSwitchStatement(Expression* tag,
Block* cases_block = factory()->NewBlock(NULL, 1, false, kNoSourcePosition);
cases_block->statements()->Add(switch_statement, zone());
cases_block->set_scope(scope);
+ DCHECK_IMPLIES(scope != nullptr,
+ switch_statement->position() >= scope->start_position());
+ DCHECK_IMPLIES(scope != nullptr,
+ switch_statement->position() < scope->end_position());
switch_block->statements()->Add(cases_block, zone());
return switch_block;
}
« no previous file with comments | « no previous file | src/parsing/parser-base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698