src/com/google/javascript/jscomp/AbstractCommandLineRunner.java
/** Save the compiler output to a JsonFileSpec to be later written to stdout */
Save the compiler output to a JsonFileSpec to be later written to stdout
Save the compiler output to a JsonFileSpec to be later written to stdout
@GwtIncompatible("Unnecessary")
  JsonFileSpec createJsonFile(B options, String outputMarker, Function<String, String> escaper)
      throws IOException {
    Appendable jsOutput = new StringBuilder();
    writeOutput(
        jsOutput, compiler, (JSModule) null, config.outputWrapper,
        outputMarker, escaper);
    JsonFileSpec jsonOutput = new JsonFileSpec(jsOutput.toString(),
        Strings.isNullOrEmpty(config.jsOutputFile) ?
            "compiled.js" : config.jsOutputFile);
    if (!Strings.isNullOrEmpty(options.sourceMapOutputPath)) {
      StringBuilder sourcemap = new StringBuilder();
      compiler.getSourceMap().appendTo(sourcemap, jsonOutput.getPath());
      jsonOutput.setSourceMap(sourcemap.toString());
    }
    return jsonOutput;
  }
@ GwtIncompatible ( "Unnecessary" ) JsonFileSpec createJsonFile ( B options , String outputMarker , Function < String , String > escaper ) throws IOException { Appendable jsOutput = new StringBuilder ( ) ; writeOutput ( jsOutput , compiler , ( JSModule ) null , config . outputWrapper , outputMarker , escaper ) ; JsonFileSpec jsonOutput = new JsonFileSpec ( jsOutput . toString ( ) , Strings . isNullOrEmpty ( config . jsOutputFile ) ? "compiled.js" : config . jsOutputFile ) ; if ( ! Strings . isNullOrEmpty ( options . sourceMapOutputPath ) ) { StringBuilder sourcemap = new StringBuilder ( ) ; compiler . getSourceMap ( ) . appendTo ( sourcemap , jsonOutput . getPath ( ) ) ; jsonOutput . setSourceMap ( sourcemap . toString ( ) ) ; } return jsonOutput ; }
Save the compiler output to a JsonFileSpec to be later written to stdout
Save the compiler output to a JsonFileSpec to be later written to stdout