Fix CompilerTestCase to rewrite provides after modules in expected code
Provide rewriting always happens after module rewriting in full compiles.
@@ -1919,11 +1919,6 @@ public abstract class CompilerTestCase {
new ProcessClosurePrimitives(compiler).process(externsRoot, mainRoot);
}
- if (rewriteClosureProvides && closurePassEnabledForExpected && !compiler.hasErrors()) {
- new ProcessClosureProvidesAndRequires(compiler, null, CheckLevel.ERROR, false)
- .process(externsRoot, mainRoot);
- }
-
if (rewriteClosureCode) {
new ClosureRewriteClass(compiler).process(externsRoot, mainRoot);
new ClosureRewriteModule(compiler, null, null).process(externsRoot, mainRoot);
@@ -1933,6 +1928,11 @@ public abstract class CompilerTestCase {
if (transpileEnabled && !compiler.hasErrors()) {
transpileToEs5(compiler, externsRoot, mainRoot);
}
+
+ if (rewriteClosureProvides && closurePassEnabledForExpected && !compiler.hasErrors()) {
+ new ProcessClosureProvidesAndRequires(compiler, null, CheckLevel.ERROR, false)
+ .process(externsRoot, mainRoot);
+ }
return mainRoot;
}
