src/com/google/javascript/jscomp/FunctionInjector.java
/**
   * @param fnName The name of this function. This either the name of the
   *  variable to which the function is assigned or the name from the FUNCTION
   *  node.
   * @param fnNode The FUNCTION node of the function to inspect.
   * @return Whether the function node meets the minimum requirements for
   * inlining.
   */
@param fnName The name of this function. This either the name of the
variable to which the function is assigned or the name from the FUNCTION
node.
@param fnNode The FUNCTION node of the function to inspect.
@return Whether the function node meets the minimum requirements for
inlining.
@param fnName The name of this function . This either the name of the variable to which the function is assigned or the name from the FUNCTION node . @param fnNode The FUNCTION node of the function to inspect . @return Whether the function node meets the minimum requirements for inlining .
boolean doesFunctionMeetMinimumRequirements(final String fnName, Node fnNode) {
    Node block = NodeUtil.getFunctionBody(fnNode);
    if (!compiler.getCodingConvention().isInlinableFunction(fnNode)) {
      return false;
    }
    final String fnRecursionName = fnNode.getFirstChild().getString();
    checkState(fnRecursionName != null);
    boolean referencesArguments =
        NodeUtil.isNameReferenced(block, "arguments", NodeUtil.MATCH_NOT_VANILLA_FUNCTION);
    Predicate<Node> blocksInjection =
        new Predicate<Node>() {
          @Override
          public boolean apply(Node n) {
            if (n.isName()) {
              return n.getString().equals("eval")
                  || (!fnName.isEmpty() && n.getString().equals(fnName))
                  || (!fnRecursionName.isEmpty() && n.getString().equals(fnRecursionName));
            } else if (n.isSuper()) {
              return true;
            }
            return false;
          }
        };
    return !referencesArguments && !NodeUtil.has(block, blocksInjection, Predicates.alwaysTrue());
  }
boolean doesFunctionMeetMinimumRequirements ( final String fnName , Node fnNode ) { Node block = NodeUtil . getFunctionBody ( fnNode ) ; if ( ! compiler . getCodingConvention ( ) . isInlinableFunction ( fnNode ) ) { return false ; } final String fnRecursionName = fnNode . getFirstChild ( ) . getString ( ) ; checkState ( fnRecursionName != null ) ; boolean referencesArguments = NodeUtil . isNameReferenced ( block , "arguments" , NodeUtil . MATCH_NOT_VANILLA_FUNCTION ) ; Predicate < Node > blocksInjection = new Predicate < Node > ( ) { @ Override public boolean apply ( Node n ) { if ( n . isName ( ) ) { return n . getString ( ) . equals ( "eval" ) || ( ! fnName . isEmpty ( ) && n . getString ( ) . equals ( fnName ) ) || ( ! fnRecursionName . isEmpty ( ) && n . getString ( ) . equals ( fnRecursionName ) ) ; } else if ( n . isSuper ( ) ) { return true ; } return false ; } } ; return ! referencesArguments && ! NodeUtil . has ( block , blocksInjection , Predicates . alwaysTrue ( ) ) ; }
@param fnName The name of this function.
@param fnName The name of this function .
// Basic restrictions on functions that can be inlined: // 0) The function is inlinable by convention // 1) It contains a reference to itself. // 2) It uses its parameters indirectly using "arguments" (it isn't //    handled yet. // 3) It references "eval". Inline a function containing eval can have //    large performance implications. // If the function references "arguments" directly in the function or in an arrow function // References "eval" or one of its names anywhere. // Don't inline if this function or its inner functions contains super