support nested arrow functions - fixes #60

This commit is contained in:
Sebastian McKenzie
2014-10-14 08:07:03 +11:00
parent b377278c2c
commit a9d101e3da
3 changed files with 34 additions and 1 deletions

View File

@@ -29,6 +29,12 @@ var go = function (getBody, node, file) {
// traverse all child nodes of this function and find arguments and this
traverse(node, function (node, parent) {
if (_aliasFunction === "arrows") {
if (traverse.isFunction(node) && node._aliasFunction !== "arrows") {
return false;
}
}
var getId;
if (node.type === "Identifier" && node.name === "arguments") {
@@ -40,7 +46,7 @@ var go = function (getBody, node, file) {
}
if (util.isReferenced(node, parent)) return getId();
}, _aliasFunction === "arrows" && ["FunctionExpression", "FunctionDeclaration"]);
});
return false;
});