Only run the postTypecheckPasses when the compiler needs transpilation from ES6
This currently has no effect since there are no Es6PostTypecheckPasses.
@@ -408,20 +408,26 @@ public final class DefaultPassConfig extends PassConfig {
}
if (options.skipNonTranspilationPasses) {
+ if (options.needsTranspilationFrom(ES6)) {
TranspilationPasses.addEs6PostTypecheckPasses(checks);
+ }
} else {
checks.add(createEmptyPass(PassNames.BEFORE_TYPE_CHECKING));
if (options.getNewTypeInference()) {
// We will not be updating NTI to understand any more new features,
// so transpile those features before running it.
+ if (options.needsTranspilationFrom(ES6)) {
TranspilationPasses.addEs6PostTypecheckPasses(checks);
+ }
checks.add(symbolTableForNewTypeInference);
checks.add(newTypeInference);
} else {
addOldTypeCheckerPasses(checks, options);
+ if (options.needsTranspilationFrom(ES6)) {
TranspilationPasses.addEs6PostTypecheckPasses(checks);
}
+ }
if (options.j2clPassMode.shouldAddJ2clPasses()) {
checks.add(j2clSourceFileChecker);
