add support for spread property

This commit is contained in:
Sebastian McKenzie 2015-02-27 22:40:56 +11:00
parent 5c226d0451
commit 041c7e246f
2 changed files with 7 additions and 1 deletions

View File

@ -44,6 +44,12 @@ var astTransformVisitor = {
if (t.isRestElement(node.params[node.params.length - 1])) { if (t.isRestElement(node.params[node.params.length - 1])) {
node.rest = node.params.pop(); node.rest = node.params.pop();
} }
} else if (t.isSpreadProperty(node)) {
node.type = "Property";
node.kind = "init";
node.computed = false;
node.key = node.value = node.argument;
delete node.argument;
} else if (t.isClassProperty(node)) { } else if (t.isClassProperty(node)) {
// eslint doesn't like these // eslint doesn't like these
this.remove(); this.remove();

View File

@ -1,6 +1,6 @@
{ {
"name": "babel-eslint", "name": "babel-eslint",
"version": "1.0.3", "version": "1.0.4",
"description": "", "description": "",
"main": "index.js", "main": "index.js",
"repository": { "repository": {