Skip to content

Commit

Permalink
fix nitpick reviews
Browse files Browse the repository at this point in the history
  • Loading branch information
tanhauhau committed Jul 20, 2019
1 parent cbab41a commit 39be06f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/babel-traverse/src/path/family.js
Expand Up @@ -56,15 +56,15 @@ function completionRecordForSwitch(cases, paths) {
paths = addCompletionRecords(prevSibling, paths);
breakStatement.remove();
} else {
breakStatement.replaceWith(switchCase.scope.buildUndefinedNode());
breakStatement.replaceWith(breakStatement.scope.buildUndefinedNode());
paths = addCompletionRecords(breakStatement, paths);
}
} else {
} else if (isLastCaseWithConsequent) {
const statementFinder = statement =>
!statement.isBlockStatement() ||
statement.get("body").some(statementFinder);
const hasConsequent = consequent.some(statementFinder);
if (hasConsequent && isLastCaseWithConsequent) {
if (hasConsequent) {
paths = addCompletionRecords(consequent[consequent.length - 1], paths);
isLastCaseWithConsequent = false;
}
Expand Down

0 comments on commit 39be06f

Please sign in to comment.