test/com/google/javascript/jscomp/BaseReplaceScriptTestCase.java
/**
   * For a given set of sources, first runs a full compile, then replaces one source with a given
   * new version and calls {@code replaceScript}.
   *
   * @param options Compiler options.
   * @param sources The list of sources.
   * @param expectedCompileErrors Expected number of errors after full compile.
   * @param expectedCompileWarnings Expected number of warnings of full compile.
   * @param newSource The source version.
   * @param newSourceInd Index of the source in {@code sources} to be replaced.
   * @param flushResults Whether to flush results after full-build or not.
   * @return The compiler which can be reused for further inc-compiles.
   */
For a given set of sources, first runs a full compile, then replaces one source with a given
new version and calls  replaceScript.

@param options Compiler options.
@param sources The list of sources.
@param expectedCompileErrors Expected number of errors after full compile.
@param expectedCompileWarnings Expected number of warnings of full compile.
@param newSource The source version.
@param newSourceInd Index of the source in  sources to be replaced.
@param flushResults Whether to flush results after full-build or not.
@return The compiler which can be reused for further inc-compiles.
For a given set of sources first runs a full compile then replaces one source with a given new version and calls replaceScript . @param options Compiler options . @param sources The list of sources . @param expectedCompileErrors Expected number of errors after full compile . @param expectedCompileWarnings Expected number of warnings of full compile . @param newSource The source version . @param newSourceInd Index of the source in sources to be replaced . @param flushResults Whether to flush results after full - build or not . @return The compiler which can be reused for further inc - compiles .
protected Compiler runReplaceScript(
      CompilerOptions options,
      List<String> sources,
      int expectedCompileErrors,
      int expectedCompileWarnings,
      String newSource,
      int newSourceInd,
      boolean flushResults) {
    checkArgument(newSourceInd < sources.size());
    Compiler compiler =
        runFullCompile(
            options, sources, expectedCompileErrors, expectedCompileWarnings, flushResults);
    doReplaceScript(compiler, newSource, newSourceInd);
    return compiler;
  }
protected Compiler runReplaceScript ( CompilerOptions options , List < String > sources , int expectedCompileErrors , int expectedCompileWarnings , String newSource , int newSourceInd , boolean flushResults ) { checkArgument ( newSourceInd < sources . size ( ) ) ; Compiler compiler = runFullCompile ( options , sources , expectedCompileErrors , expectedCompileWarnings , flushResults ) ; doReplaceScript ( compiler , newSource , newSourceInd ) ; return compiler ; }
For a given set of sources, first runs a full compile, then replaces one source with a given
 new version and calls {@code replaceScript}.
For a given set of sources first runs a full compile then replaces one source with a given new version and calls { @code replaceScript } .
// First do a full compile. // Now replace one of the source files and run replaceScript.