code: function getEncloseFunctionDeclaration(reference) {
      let node = reference.identifier;
  
      while (node) {
          if (node.type === "FunctionDeclaration") {
              return node.id ? node : null;
          }
  
          node = node.parent;
      }
  
      return null;
  }
docs: Gets the function which encloses a given reference.
  This supports only FunctionDeclaration.
  
  @param {eslint-scope.Reference} reference - A reference to get.
  @returns {ASTNode|null} The function node or null.