Improve performance (#13376)
This commit is contained in:
parent
4ee6a27780
commit
dbfa87740c
@ -750,7 +750,7 @@ class BlockScoping {
|
|||||||
getLetReferences() {
|
getLetReferences() {
|
||||||
const block = this.block;
|
const block = this.block;
|
||||||
|
|
||||||
let declarators = [];
|
const declarators = [];
|
||||||
|
|
||||||
if (this.loop) {
|
if (this.loop) {
|
||||||
const init = this.loop.left || this.loop.init;
|
const init = this.loop.left || this.loop.init;
|
||||||
@ -773,7 +773,13 @@ class BlockScoping {
|
|||||||
if (isBlockScoped(node)) {
|
if (isBlockScoped(node)) {
|
||||||
convertBlockScopedToVar(path, node, block, this.scope);
|
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)) {
|
if (t.isLabeledStatement(node)) {
|
||||||
addDeclarationsFromChild(path.get("body"), node.body);
|
addDeclarationsFromChild(path.get("body"), node.body);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user