Extract shouldWritePreReleaseFlag(), use in JS as well as JVM

Fix the difference in behavior between JS and JVM
This commit is contained in:
Alexander Udalov
2017-10-12 18:29:12 +02:00
parent 0510c553c3
commit 8b0b334601
6 changed files with 47 additions and 23 deletions
@@ -184,3 +184,9 @@ class LanguageVersionSettingsImpl @JvmOverloads constructor(
val DEFAULT = LanguageVersionSettingsImpl(LanguageVersion.LATEST_STABLE, ApiVersion.LATEST_STABLE)
}
}
fun LanguageVersionSettings.shouldWritePreReleaseFlag(): Boolean {
if (!languageVersion.isStable) return true
return KotlinCompilerVersion.isPreRelease() && languageVersion == LanguageVersion.LATEST_STABLE
}