Skip to content

Commit

Permalink
add more comments to acorn-to-esprima source
Browse files Browse the repository at this point in the history
  • Loading branch information
sebmck committed Feb 27, 2015
1 parent d2d870e commit 331d0c7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion eslint/babel-eslint-parser/acorn-to-esprima.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,13 @@ var astTransformVisitor = {
noScope: true,
enter: function (node) {
if (t.isImportBatchSpecifier(node)) {
// ImportBatchSpecifier<name> => ImportNamespaceSpecifier<id>
node.type = "ImportNamespaceSpecifier";
node.id = node.name;
delete node.name;
} else if (t.isFunction(node)) {
// defaults
node.defaults = [];

node.params = node.params.map(function (param) {
if (t.isAssignmentPattern(param)) {
node.defaults.push(param.right);
Expand All @@ -44,6 +45,7 @@ var astTransformVisitor = {
node.rest = node.params.pop();
}
} else if (t.isClassProperty(node)) {
// eslint doesn't like these
this.remove();
}
}
Expand Down

0 comments on commit 331d0c7

Please sign in to comment.