diff options
author | Benjamin Coe <bencoe@google.com> | 2019-09-19 19:50:23 -0700 |
---|---|---|
committer | Myles Borins <myles.borins@gmail.com> | 2019-10-07 03:20:14 -0400 |
commit | 019b23b3e4c3decd47246f7306b690c115e9b3e9 (patch) | |
tree | 8737022449abcdc65fe108d974a1be17f7ff9286 /deps/v8/src | |
parent | 174723354ef6ad20e423c44b6d8af63ef7a0040c (diff) | |
download | android-node-v8-019b23b3e4c3decd47246f7306b690c115e9b3e9.tar.gz android-node-v8-019b23b3e4c3decd47246f7306b690c115e9b3e9.tar.bz2 android-node-v8-019b23b3e4c3decd47246f7306b690c115e9b3e9.zip |
deps: V8: cherry-pick deac757
Original commit message:
[debugger] Fix code coverage for break/return inside switch-case
Case statements have a list of statements associated with them, but are
not blocks, and were hence not fixed-up correctly for code coverage.
This CL also applies the fix-up to the "body" of case statements,
in this way removing ranges reported as uncovered between the final
break/return in a case and the next case (or end of function).
Drive-by: Add optional pretty printing to code coverage test results.
Change-Id: I5f4002d4e17b7253ed516d99f7c389ab2264be10
Bug: v8:9705
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1798426
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#63719}
Refs: https://github.com/v8/v8/commit/deac757bc76d207845375340bcea090c774ad9d0
PR-URL: https://github.com/nodejs/node/pull/29626
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Shelley Vohr <codebytere@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Diffstat (limited to 'deps/v8/src')
-rw-r--r-- | deps/v8/src/ast/source-range-ast-visitor.cc | 8 | ||||
-rw-r--r-- | deps/v8/src/ast/source-range-ast-visitor.h | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/deps/v8/src/ast/source-range-ast-visitor.cc b/deps/v8/src/ast/source-range-ast-visitor.cc index d171e30587..2fcf151999 100644 --- a/deps/v8/src/ast/source-range-ast-visitor.cc +++ b/deps/v8/src/ast/source-range-ast-visitor.cc @@ -25,6 +25,14 @@ void SourceRangeAstVisitor::VisitBlock(Block* stmt) { } } +void SourceRangeAstVisitor::VisitSwitchStatement(SwitchStatement* stmt) { + AstTraversalVisitor::VisitSwitchStatement(stmt); + ZonePtrList<CaseClause>* clauses = stmt->cases(); + for (CaseClause* clause : *clauses) { + MaybeRemoveLastContinuationRange(clause->statements()); + } +} + void SourceRangeAstVisitor::VisitFunctionLiteral(FunctionLiteral* expr) { AstTraversalVisitor::VisitFunctionLiteral(expr); ZonePtrList<Statement>* stmts = expr->body(); diff --git a/deps/v8/src/ast/source-range-ast-visitor.h b/deps/v8/src/ast/source-range-ast-visitor.h index 4ea36a947f..4ba5feb2d2 100644 --- a/deps/v8/src/ast/source-range-ast-visitor.h +++ b/deps/v8/src/ast/source-range-ast-visitor.h @@ -34,6 +34,7 @@ class SourceRangeAstVisitor final friend class AstTraversalVisitor<SourceRangeAstVisitor>; void VisitBlock(Block* stmt); + void VisitSwitchStatement(SwitchStatement* stmt); void VisitFunctionLiteral(FunctionLiteral* expr); bool VisitNode(AstNode* node); |