Merge branch 'master' into code-generator
This commit is contained in:
commit
bbffde374e
@ -4,7 +4,7 @@
|
||||
|
||||
<p align="center">
|
||||
<a href="https://travis-ci.org/sebmck/6to5">
|
||||
<img alt="Travis Status" src="http://img.shields.io/travis/sebmck/6to5.svg?style=flat&label=travis">
|
||||
<img alt="Travis Status" src="http://img.shields.io/travis/sebmck/6to5.svg?branch=master&style=flat&label=travis">
|
||||
</a>
|
||||
|
||||
<a href="https://codeclimate.com/github/sebmck/6to5">
|
||||
|
||||
@ -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;
|
||||
};
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "6to5",
|
||||
"description": "Turn ES6 code into readable vanilla ES5 with source maps",
|
||||
"version": "1.10.8",
|
||||
"version": "1.10.9",
|
||||
"author": "Sebastian McKenzie <sebmck@gmail.com>",
|
||||
"homepage": "https://github.com/sebmck/6to5",
|
||||
"repository": {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user