summaryrefslogtreecommitdiff
path: root/deps/v8/src/parsing/parser.cc
diff options
context:
space:
mode:
authorFranziska Hinkelmann <franzih@chromium.org>2017-03-17 19:36:27 +0100
committerFranziska Hinkelmann <franziska.hinkelmann@gmail.com>2017-03-19 21:41:47 +0100
commitdd8982dc742107f0a540c8eb24626bb6ce9456bb (patch)
tree9634fac2642318109bb8a05e82086702cfa768ff /deps/v8/src/parsing/parser.cc
parent5bda5faffdeefa448965159e524eacdd14490436 (diff)
downloadandroid-node-v8-dd8982dc742107f0a540c8eb24626bb6ce9456bb.tar.gz
android-node-v8-dd8982dc742107f0a540c8eb24626bb6ce9456bb.tar.bz2
android-node-v8-dd8982dc742107f0a540c8eb24626bb6ce9456bb.zip
deps: cherry-pick 09de996 from V8 upstream
Original commit message: [debugger] fix switch block source positions. The switch statement itself is part of the switch block. However, the source position of the statement is outside of the block. This leads to confusion for the debugger, if the switch block pushes a block context: the current context is a block context, but the scope analysis based on the current source position tells the debugger that we should be outside the scope, so we should have the function context. R=marja@chromium.org BUG=v8:6085 Review-Url: https://codereview.chromium.org/2744213003 Cr-Commit-Position: refs/heads/master@{#43744} Committed: https://chromium.googlesource.com/v8/v8/+/09de9969ccb9bc3bbd667788afad665b309d02f5 Fixes: https://github.com/nodejs/node/issues/11746 PR-URL: https://github.com/nodejs/node/pull/11905 Fixes: https://github.com/nodejs/node/issues/11746 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Diffstat (limited to 'deps/v8/src/parsing/parser.cc')
-rw-r--r--deps/v8/src/parsing/parser.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/deps/v8/src/parsing/parser.cc b/deps/v8/src/parsing/parser.cc
index 8d8890129f..3ed7af267e 100644
--- a/deps/v8/src/parsing/parser.cc
+++ b/deps/v8/src/parsing/parser.cc
@@ -1729,6 +1729,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;
}