lib/util/ast-utils.js
function getUpperFunction(node) {
    for (let currentNode = node; currentNode; currentNode = currentNode.parent) {
        if (anyFunctionPattern.test(currentNode.type)) {
            return currentNode;
        }
    }
    return null;
}
function getUpperFunction(node) {
    for (let currentNode = node; currentNode; currentNode = currentNode.parent) {
        if (anyFunctionPattern.test(currentNode.type)) {
            return currentNode;
        }
    }
    return null;
}
function getUpperFunction ( node ) { for ( let currentNode = node ; currentNode ; currentNode = currentNode . parent ) { if ( anyFunctionPattern . test ( currentNode . type ) ) { return currentNode ; } } return null ; }
Finds a function node from ancestors of a node.
@param {ASTNode} node - A start node to find.
@returns {Node|null} A found function node.
Finds a function node from ancestors of a node .