Move Es7 Transpilation after NTI if getTypeCheckES6Natively is turned on.
@@ -368,7 +368,7 @@ public final class DefaultPassConfig extends PassConfig {
checks.add(setFeatureSet(ES7));
}
- if (options.needsTranspilationFrom(ES7)) {
+ if (options.needsTranspilationFrom(ES7) && !options.getTypeCheckEs6Natively()) {
TranspilationPasses.addEs2016Passes(checks);
checks.add(setFeatureSet(ES6));
}
@@ -406,15 +406,22 @@ public final class DefaultPassConfig extends PassConfig {
// End of ES6 transpilation passes before NTI.
- if (!options.skipNonTranspilationPasses && options.getTypeCheckEs6Natively()) {
+ if (options.getTypeCheckEs6Natively()) {
+ if (!options.skipNonTranspilationPasses) {
checks.add(createEmptyPass(PassNames.BEFORE_TYPE_CHECKING));
addNewTypeCheckerPasses(checks, options);
}
- if (options.needsTranspilationFrom(ES6) && options.getTypeCheckEs6Natively()) {
+ if (options.needsTranspilationFrom(ES7)) {
+ TranspilationPasses.addEs2016Passes(checks);
+ checks.add(setFeatureSet(ES6));
+ }
+
+ if (options.needsTranspilationFrom(ES6)) {
TranspilationPasses.addEs6PassesAfterNTI(checks);
checks.add(setFeatureSet(options.getLanguageOut().toFeatureSet()));
}
+ }
if (!options.skipNonTranspilationPasses) {
addNonTranspilationCheckPasses(checks);
