Stop transpilation after a pass emits an error.
This allows reporting a transpilation error correctly, rather than an internal compiler error when a later pass encounters a node it can't deal with.
@@ -1043,6 +1043,9 @@ public class Compiler extends AbstractCompiler implements ErrorHandler, SourceFi
Tracer t = newTracer("runTranspileOnlyPasses");
try {
for (PassFactory pf : getPassConfig().getTranspileOnlyPasses()) {
+ if (hasErrors()) {
+ return;
+ }
pf.create(this).process(externsRoot, jsRoot);
}
} finally {
