Misc: Protect freeArgs with FreezableVar

Original commit: 87f3d24f9b
This commit is contained in:
Alexey Sedunov
2017-10-12 19:46:18 +03:00
parent 1079d74422
commit 5ec73d6fbd
3 changed files with 3 additions and 2 deletions
@@ -59,6 +59,7 @@ private fun readV1Config(element: Element): KotlinFacetSettings {
val jsArgumentsElement = compilerInfoElement?.getOptionBody("k2jsCompilerArguments") val jsArgumentsElement = compilerInfoElement?.getOptionBody("k2jsCompilerArguments")
val compilerArguments = targetPlatform.createCompilerArguments() val compilerArguments = targetPlatform.createCompilerArguments()
compilerArguments.freeArgs = ArrayList()
commonArgumentsElement?.let { XmlSerializer.deserializeInto(compilerArguments, it) } commonArgumentsElement?.let { XmlSerializer.deserializeInto(compilerArguments, it) }
when (compilerArguments) { when (compilerArguments) {
@@ -138,7 +138,7 @@ abstract class AbstractJsLookupTrackerTest : AbstractLookupTrackerTest() {
val args = K2JSCompilerArguments().apply { val args = K2JSCompilerArguments().apply {
outputFile = File(outDir, "out.js").canonicalPath outputFile = File(outDir, "out.js").canonicalPath
reportOutputFiles = true reportOutputFiles = true
freeArgs.addAll(filesToCompile.map { it.canonicalPath }) freeArgs = filesToCompile.map { it.canonicalPath }
} }
return runJSCompiler(args, env) return runJSCompiler(args, env)
} }
@@ -56,7 +56,7 @@ abstract class AbstractJsProtoComparisonTest : AbstractProtoComparisonTest<Proto
outputFile = File(outputDir, "out.js").canonicalPath outputFile = File(outputDir, "out.js").canonicalPath
metaInfo = true metaInfo = true
main = K2JsArgumentConstants.NO_CALL main = K2JsArgumentConstants.NO_CALL
freeArgs.addAll(ktFiles) freeArgs = ktFiles
} }
val env = createTestingCompilerEnvironment(messageCollector, outputItemsCollector, services) val env = createTestingCompilerEnvironment(messageCollector, outputItemsCollector, services)