stop _alias-functions transformer when hitting a function that's not an arrow function - fixes #145
This commit is contained in:
parent
d90383b1ba
commit
def4319058
@ -16,8 +16,7 @@ var go = function (getBody, node, file, scope) {
|
||||
// traverse the function and find all alias functions so we can alias
|
||||
// arguments and this if necessary
|
||||
traverse(node, function (node) {
|
||||
var _aliasFunction = node._aliasFunction;
|
||||
if (!_aliasFunction) {
|
||||
if (!node._aliasFunction) {
|
||||
if (t.isFunction(node)) {
|
||||
// stop traversal of this node as it'll be hit again by this transformer
|
||||
return false;
|
||||
@ -28,10 +27,8 @@ var go = function (getBody, node, file, scope) {
|
||||
|
||||
// traverse all child nodes of this function and find arguments and this
|
||||
traverse(node, function (node, parent) {
|
||||
if (_aliasFunction === "arrows") {
|
||||
if (t.isFunction(node) && node._aliasFunction !== "arrows") {
|
||||
return false;
|
||||
}
|
||||
if (t.isFunction(node) && node._aliasFunction !== "arrows") {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (node._ignoreAliasFunctions) return;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user