JS: fix double compareTo behaviour for NaN and +-0 (KT-22723)
This commit is contained in:
+6
@@ -151,6 +151,12 @@ abstract class CommonCompilerArguments : CommonToolArguments() {
|
||||
)
|
||||
var useExperimental: Array<String>? by FreezableVar(null)
|
||||
|
||||
@Argument(
|
||||
value = "-Xproper-ieee754-comparisons",
|
||||
description = "Generate proper IEEE 754 comparisons in all cases if values are statically known to be of primitive numeric types"
|
||||
)
|
||||
var properIeee754Comparisons by FreezableVar(false)
|
||||
|
||||
open fun configureAnalysisFlags(collector: MessageCollector): MutableMap<AnalysisFlag<*>, Any> {
|
||||
return HashMap<AnalysisFlag<*>, Any>().apply {
|
||||
put(AnalysisFlag.skipMetadataVersionCheck, skipMetadataVersionCheck)
|
||||
|
||||
-6
@@ -224,12 +224,6 @@ class K2JVMCompilerArguments : CommonCompilerArguments() {
|
||||
)
|
||||
var noExceptionOnExplicitEqualsForBoxedNull by FreezableVar(false)
|
||||
|
||||
@Argument(
|
||||
value = "-Xproper-ieee754-comparisons",
|
||||
description = "Generate proper IEEE 754 comparisons in all cases if values are statically known to be of primitive numeric types"
|
||||
)
|
||||
var properIeee754Comparisons by FreezableVar(false)
|
||||
|
||||
// Paths to output directories for friend modules.
|
||||
var friendPaths: Array<String>? by FreezableVar(null)
|
||||
|
||||
|
||||
@@ -226,6 +226,9 @@ public abstract class CLICompiler<A extends CommonCompilerArguments> extends CLI
|
||||
extraLanguageFeatures.put(LanguageFeature.ReadDeserializedContracts, LanguageFeature.State.ENABLED);
|
||||
}
|
||||
|
||||
if (arguments.getProperIeee754Comparisons()) {
|
||||
extraLanguageFeatures.put(LanguageFeature.ProperIeee754Comparisons, LanguageFeature.State.ENABLED);
|
||||
}
|
||||
|
||||
setupPlatformSpecificLanguageFeatureSettings(extraLanguageFeatures, arguments);
|
||||
|
||||
|
||||
@@ -235,10 +235,6 @@ class K2JVMCompiler : CLICompiler<K2JVMCompilerArguments>() {
|
||||
extraLanguageFeatures[LanguageFeature.StrictJavaNullabilityAssertions] = LanguageFeature.State.ENABLED
|
||||
}
|
||||
|
||||
if (commandLineArguments.properIeee754Comparisons) {
|
||||
extraLanguageFeatures[LanguageFeature.ProperIeee754Comparisons] = LanguageFeature.State.ENABLED
|
||||
}
|
||||
|
||||
super.setupPlatformSpecificLanguageFeatureSettings(extraLanguageFeatures, commandLineArguments)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user