Skip to content

Commit 4e74795

Browse files
author
Alexej Yaroshevich
committed
drop esprima tree direct requirement
1 parent cf82c9b commit 4e74795

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/esprima-helpers.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
module.exports = {
2-
closestScopeNode : closestScopeNode,
3-
treeIterator : require('jscs/lib/tree-iterator')
2+
closestScopeNode : closestScopeNode
43
};
54

65
var scopeNodeTypes = [

lib/rules/validate-jsdoc.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ module.exports.prototype = {
5959

6060
check: function(file, errors) {
6161
patchNodesInFile(file);
62+
this._iterate = file.iterate;
6263

6364
var _this = this;
6465
var scopes = {
@@ -156,13 +157,13 @@ module.exports.prototype = {
156157
}
157158

158159
var statements = [];
159-
esprimaHelpers.treeIterator.iterate(node, function(n/*, parentNode, parentCollection*/) {
160+
this._iterate(function(n) {
160161
if (n && n.type === 'ReturnStatement' && n.argument) {
161162
if (node === esprimaHelpers.closestScopeNode(n)) {
162163
statements.push(n.argument);
163164
}
164165
}
165-
});
166+
}, node);
166167

167168
node.jsdoc.returnStatements = statements;
168169
return statements;

0 commit comments

Comments
 (0)