Skip to content

Commit

Permalink
Minor refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
fedeci committed Aug 7, 2021
1 parent 49e3e71 commit be8a9b8
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions packages/babel-traverse/src/path/family.ts
Expand Up @@ -185,12 +185,16 @@ function getStatementListCompletion(
if (i === paths.length - 1) {
completions.push(...statementCompletions);
} else {
completions.push(
...statementCompletions.filter(c => c.type === BREAK_COMPLETION),
);
lastNormalCompletions = statementCompletions.filter(
c => c.type === NORMAL_COMPLETION,
);
lastNormalCompletions = [];
for (let i = 0; i < statementCompletions.length; i++) {
const c = statementCompletions[i];
if (c.type === BREAK_COMPLETION) {
completions.push(c);
}
if (c.type === NORMAL_COMPLETION) {
lastNormalCompletions.push(c);
}
}
}
}
} else if (paths.length) {
Expand Down

0 comments on commit be8a9b8

Please sign in to comment.