(node, scope, ancestors)
| 2081 | |
| 2082 | exports.findRefs = function(ast, baseScope, name, refScope, f) { |
| 2083 | function handleId(node, scope, ancestors) { |
| 2084 | if (node.name != name || |
| 2085 | (node == ast.id && ast.type == "FunctionDeclaration")) return; |
| 2086 | for (var s = scope; s; s = s.prev) { |
| 2087 | if (s == refScope) f(node, scope, ancestors); |
| 2088 | if (name in s.props) return; |
| 2089 | } |
| 2090 | } |
| 2091 | walk.ancestor(ast, {Identifier: handleId, VariablePattern: handleId}, |
| 2092 | exports.fullVisitor, baseScope) |
| 2093 | }; |