src/com/google/javascript/jscomp/FunctionInjector.java
/**
   * Determines whether a function can be inlined at a particular call site.
   * There are several criteria that the function and reference must hold in
   * order for the functions to be inlined:
   * - It must be a simple call, or assignment, or var initialization.
   * <pre>
   *    f();
   *    a = foo();
   *    var a = foo();
   * </pre>
   */
Determines whether a function can be inlined at a particular call site.
There are several criteria that the function and reference must hold in
order for the functions to be inlined:
- It must be a simple call, or assignment, or var initialization.
Determines whether a function can be inlined at a particular call site . There are several criteria that the function and reference must hold in order for the functions to be inlined : - It must be a simple call or assignment or var initialization .
private CanInlineResult canInlineReferenceAsStatementBlock(
      Reference ref, Node fnNode, ImmutableSet<String> namesToAlias) {
    CallSiteType callSiteType = classifyCallSite(ref);
    if (callSiteType == CallSiteType.UNSUPPORTED) {
      return CanInlineResult.NO;
    }
    if (!allowDecomposition
        && (callSiteType == CallSiteType.DECOMPOSABLE_EXPRESSION
            || callSiteType == CallSiteType.EXPRESSION)) {
      return CanInlineResult.NO;
    }
    if (!callMeetsBlockInliningRequirements(ref, fnNode, namesToAlias)) {
      return CanInlineResult.NO;
    }
    if (callSiteType == CallSiteType.DECOMPOSABLE_EXPRESSION
        || callSiteType == CallSiteType.EXPRESSION) {
      return CanInlineResult.AFTER_PREPARATION;
    } else {
      return CanInlineResult.YES;
    }
  }
private CanInlineResult canInlineReferenceAsStatementBlock ( Reference ref , Node fnNode , ImmutableSet < String > namesToAlias ) { CallSiteType callSiteType = classifyCallSite ( ref ) ; if ( callSiteType == CallSiteType . UNSUPPORTED ) { return CanInlineResult . NO ; } if ( ! allowDecomposition && ( callSiteType == CallSiteType . DECOMPOSABLE_EXPRESSION || callSiteType == CallSiteType . EXPRESSION ) ) { return CanInlineResult . NO ; } if ( ! callMeetsBlockInliningRequirements ( ref , fnNode , namesToAlias ) ) { return CanInlineResult . NO ; } if ( callSiteType == CallSiteType . DECOMPOSABLE_EXPRESSION || callSiteType == CallSiteType . EXPRESSION ) { return CanInlineResult . AFTER_PREPARATION ; } else { return CanInlineResult . YES ; } }
Determines whether a function can be inlined at a particular call site.
Determines whether a function can be inlined at a particular call site .