Skip to content

Commit

Permalink
explode all rest elements - fixes #11
Browse files Browse the repository at this point in the history
  • Loading branch information
sebmck committed Feb 28, 2015
1 parent 9ac2472 commit 65bdce3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion eslint/babel-eslint-parser/acorn-to-esprima.js
Expand Up @@ -30,6 +30,10 @@ var astTransformVisitor = {
delete node.argument;
}

if (t.isRestElement(node)) {
return node.argument;
}

if (t.isImportBatchSpecifier(node)) {
// ImportBatchSpecifier<name> => ImportNamespaceSpecifier<id>
node.type = "ImportNamespaceSpecifier";
Expand Down Expand Up @@ -67,7 +71,6 @@ var astTransformVisitor = {
node.defaults.push(param.right);
return param.left;
} else {
if (t.isRestElement(param)) param = param.argument;
node.defaults.push(null);
return param;
}
Expand Down
2 changes: 1 addition & 1 deletion eslint/babel-eslint-parser/package.json
@@ -1,6 +1,6 @@
{
"name": "babel-eslint",
"version": "1.0.9",
"version": "1.0.10",
"description": "",
"main": "index.js",
"repository": {
Expand Down

0 comments on commit 65bdce3

Please sign in to comment.