code: static void hotSwapTranspile(
        AbstractCompiler compiler, Node scriptRoot, FeatureSet featureSet, Callback... callbacks) {
      if (compiler.getOptions().needsTranspilationFrom(featureSet)) {
        FeatureSet languageOutFeatures = compiler.getOptions().getOutputFeatureSet();
        if (doesScriptHaveUnsupportedFeatures(scriptRoot, languageOutFeatures)) {
          for (Callback callback : callbacks) {
            scriptRoot.putBooleanProp(Node.TRANSPILED, true);
            NodeTraversal.traverse(compiler, scriptRoot, callback);
          }
        }
      }
    }
docs: Hot-swap ES6+ transpilations if the input language needs transpilation from certain features,
  on any JS file that has features not present in the compiler's output language mode.
  
  @param compiler An AbstractCompiler
  @param scriptRoot The SCRIPT root for the JS file.
  @param featureSet The features which this pass helps transpile.
  @param callbacks The callbacks that should be invoked if the file has ES6 features.