code: function findScope (ast, item) {
    var scopes = [],
        found = false;
    traverse.traverse(ast, {
      enter: function (node, parent) {
        if (node.type === 'FunctionDeclaration' || node.type === 'FunctionExpression') {
          scopes.push(node);
        }
        else if (node === item) {
          found = scopes[scopes.length - 1];
          this.break();
        }
      },
      leave: function (node, parent) {
        if (node.type === 'FunctionDeclaration' || node.type === 'FunctionExpression') {
          scopes.pop();
        }
      }
    });
    return found ? found.body : false;
  }
docs: Find the scope for an item in the AST.