Always sort files in K2JSCompiler

Previously files were sorted only when IncrementalDataProvider
was not null to normalize js output in case of incremental compilation.
Because of that an output js file could be different after rebuild
in IC tests.
The issue could be reproduced anywhere, but the tests failed only on
Windows, and it seems tests were not run on Windows for some time.
This commit is contained in:
Alexey Tsvetkov
2018-01-22 16:15:29 +03:00
parent 21f2b68357
commit f77586574f
@@ -146,6 +146,7 @@ public class K2JSCompiler extends CLICompiler<K2JSCompilerArguments> {
return translator.translateUnits(reporter, translationUnits, mainCallParameters, jsAnalysisResult);
}
CollectionsKt.sortBy(allKotlinFiles, ktFile -> VfsUtilCore.virtualToIoFile(ktFile.getVirtualFile()));
return translator.translate(reporter, allKotlinFiles, mainCallParameters, jsAnalysisResult);
}