code: private boolean isEligibleDefinitionFunction(Node definitionFunction) {
      checkArgument(definitionFunction.isFunction(), definitionFunction);
  
      if (definitionFunction.isArrowFunction()) {
        return false;
      }
  
      for (Node ancestor = definitionFunction.getParent();
          ancestor != null;
          ancestor = ancestor.getParent()) {
        // The definition must be made exactly once. (i.e. not in a loop, conditional, or function)
        if (isScopingOrBranchingConstruct(ancestor)) {
          return false;
        }
  
        // TODO(nickreid): Support this so long as the definition doesn't reference the name.
        // We can't allow this in general because references to the local name:
        //  - won't be rewritten correctly
        //  - won't be the same across multiple definitions, even if they are node-wise identical.
        if (ancestor.isClass() && localNameIsDeclaredByClass(ancestor)) {
          return false;
        }
      }
  
      if (NodeUtil.containsType(definitionFunction, Token.SUPER)) {
        // TODO(b/120452418): Remove this when we have a rewrite for `super`. We punted initially due
        // to complexity.
        return false;
      }
  
      if (NodeUtil.doesFunctionReferenceOwnArgumentsObject(definitionFunction)) {
        // Functions that access "arguments" are not eligible since rewriting changes the structure of
        // the function params.
        return false;
      }
  
      return true;
    }
docs: Determines if a method definition function is eligible for rewrite as a global function.
  
  <p>In order to be eligible for rewrite, the definition function must:
  
  <ul>
  <li>Be instantiated exactly once
  <li>Be the only possible implementation at a given site
  <li>Not refer to its `arguments`; no implicit varags
  <li>Not be an arrow function
  </ul>