Preserve _blockHoist values for injected binding references. (#6269)

This commit is contained in:
Logan Smyth
2017-09-19 09:53:18 -07:00
committed by GitHub
parent bd734f03fb
commit fc1e1c5668

View File

@@ -88,6 +88,7 @@ const rewriteBindingInitVisitor = {
t.identifier(localName),
),
);
statement._blockHoist = path.node._blockHoist;
requeueInParent(path.insertAfter(statement)[0]);
}
@@ -105,6 +106,7 @@ const rewriteBindingInitVisitor = {
t.identifier(localName),
),
);
statement._blockHoist = path.node._blockHoist;
requeueInParent(path.insertAfter(statement)[0]);
}
@@ -338,6 +340,7 @@ const rewriteReferencesVisitor = {
let node = t.sequenceExpression(items);
if (path.parentPath.isExpressionStatement()) {
node = t.expressionStatement(node);
node._blockHoist = path.parentPath.node._blockHoist;
}
const statement = path.insertAfter(node)[0];