Move removeTypes to come right after markUnnormalized
@@ -833,6 +833,10 @@ public final class DefaultPassConfig extends PassConfig {
// Passes after this point can no longer depend on normalized AST assumptions.
passes.add(markUnnormalized);
+ if (options.checkTypes || options.inferTypes) {
+ passes.add(removeTypes);
+ }
+
if (options.collapseVariableDeclarations) {
passes.add(exploitAssign);
passes.add(collapseVariableDeclarations);
@@ -860,8 +864,6 @@ public final class DefaultPassConfig extends PassConfig {
passes.add(latePeepholeOptimizations);
}
- passes.add(removeTypes);
-
if (options.anonymousFunctionNaming == AnonymousFunctionNamingPolicy.UNMAPPED) {
passes.add(nameUnmappedAnonymousFunctions);
}
