don't hoist regenerator variable declarations in system module formatter
This commit is contained in:
@@ -111,16 +111,20 @@ var hoistVariablesVisitor = {
|
||||
return;
|
||||
}
|
||||
|
||||
// ignore block hoisted nodes as these can be left in
|
||||
if (node._blockHoist) return;
|
||||
|
||||
var nodes = [];
|
||||
|
||||
_.each(node.declarations, function (declar) {
|
||||
for (var i = 0; i < node.declarations.length; i++) {
|
||||
var declar = node.declarations[i];
|
||||
hoistDeclarators.push(t.variableDeclarator(declar.id));
|
||||
if (declar.init) {
|
||||
// no initializer so we can just hoist it as-is
|
||||
var assign = t.expressionStatement(t.assignmentExpression("=", declar.id, declar.init));
|
||||
nodes.push(assign);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// for (var i in test)
|
||||
// for (var i = 0;;)
|
||||
|
||||
Reference in New Issue
Block a user