Skip to content

Commit

Permalink
Improve performance
Browse files Browse the repository at this point in the history
  • Loading branch information
sokra committed May 26, 2021
1 parent 4ee6a27 commit aa39663
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/babel-plugin-transform-block-scoping/src/index.js
Expand Up @@ -773,7 +773,13 @@ class BlockScoping {
if (isBlockScoped(node)) {
convertBlockScopedToVar(path, node, block, this.scope);
}
declarators = declarators.concat(node.declarations || node);
if (node.declarations) {
for (let i = 0; i < node.declarations.length; i++) {
declarators.push(node.declarations[i]);
}
} else {
declarators.push(node);
}
}
if (t.isLabeledStatement(node)) {
addDeclarationsFromChild(path.get("body"), node.body);
Expand Down

0 comments on commit aa39663

Please sign in to comment.