Merge branch 'master' into code-generator
This commit is contained in:
@@ -147,5 +147,22 @@ exports.VariableDeclaration = function (node, parent, file) {
|
||||
}
|
||||
});
|
||||
|
||||
if (parent.type !== "Program" && parent.type !== "BlockStatement") {
|
||||
var declar;
|
||||
|
||||
_.each(nodes, function (node) {
|
||||
declar = declar || b.variableDeclaration(node.kind, []);
|
||||
|
||||
if (node.type !== "VariableDeclaration" && declar.kind !== node.kind) {
|
||||
throw util.errorWithNode(node, "Cannot use this node within the current parent");
|
||||
}
|
||||
|
||||
declar.declarations = declar.declarations.concat(node.declarations);
|
||||
});
|
||||
|
||||
return declar;
|
||||
}
|
||||
|
||||
return nodes;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user