mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 00:19:48 +00:00
[dart2wasm] Fix isNegative on NaN values
New passing tests: - co19/LibTest/core/double/isNegative_A01_t01 - corelib/nan_infinity_test/01 - corelib/nan_infinity_test/none - language/unsorted/intrinsified_methods_test Change-Id: I379525fe0da36d6fc365d275ded9370f2b5b4812 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274541 Reviewed-by: Aske Simon Christensen <askesc@google.com> Commit-Queue: Ömer Ağacan <omersa@google.com>
This commit is contained in:
parent
1495d298f4
commit
001433992c
|
@ -137,6 +137,9 @@ class _BoxedDouble extends double {
|
|||
bool operator <=(num other) => this <= other.toDouble(); // Intrinsic <=
|
||||
|
||||
bool get isNegative {
|
||||
if (isNaN) {
|
||||
return false;
|
||||
}
|
||||
int bits = doubleToIntBits(this);
|
||||
return (bits & _signMask) != 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue