code: @GwtIncompatible("Unnecessary")
    void writeOutput(
        Appendable out,
        Compiler compiler,
        @Nullable JSModule module,
        String wrapper,
        String codePlaceholder,
        @Nullable Function<String, String> escaper)
        throws IOException {
      if (compiler.getOptions().outputJs == OutputJs.SENTINEL) {
        out.append("// No JS output because the compiler was run in checks-only mode.\n");
        return;
      }
      checkState(compiler.getOptions().outputJs == OutputJs.NORMAL);
  
      String code = module == null ? compiler.toSource() : compiler.toSource(module);
      writeOutput(out, compiler, code, wrapper, codePlaceholder, escaper);
    }
docs: Writes code to an output stream, optionally wrapping it in an arbitrary wrapper that contains a
  placeholder where the code should be inserted.
  
  @param module Which module to write. If this is null, write the entire AST.