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; |
} |