Skip to content

Commit 31e3ee0

Browse files
tbreisacherlauraharker
tbreisacher
authored andcommitted
Automated g4 rollback of changelist 172155957.
*** Reason for rollback *** Need to roll this back to unblock rollback of #2641 *** Original change description *** Always transpile modules, even if the output language requested was ES6 or higher. Since the compiler outputs a single file, it doesn't make sense to leave the import/export statements alone, unless the input to the compiler was just a single file, which is very rare. This allows for projects that are using ES6 modules to pass --language_out=ES_2015 or higher. *** ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=172167855
1 parent d5b1004 commit 31e3ee0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/com/google/javascript/jscomp/DefaultPassConfig.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ protected List<PassFactory> getTranspileOnlyPasses() {
154154
passes.add(convertEs6TypedToEs6);
155155
}
156156

157-
if (options.getLanguageIn().toFeatureSet().has(FeatureSet.Feature.MODULES)) {
157+
if (options.needsTranspilationOf(FeatureSet.Feature.MODULES)) {
158158
TranspilationPasses.addEs6ModulePass(passes);
159159
}
160160

@@ -278,7 +278,7 @@ protected List<PassFactory> getChecks() {
278278
checks.add(checkRequires);
279279
}
280280

281-
if (options.getLanguageIn().toFeatureSet().has(FeatureSet.Feature.MODULES)) {
281+
if (options.needsTranspilationOf(FeatureSet.Feature.MODULES)) {
282282
TranspilationPasses.addEs6ModulePass(checks);
283283
}
284284

0 commit comments

Comments
 (0)