Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(507)

Unified Diff: lib/compiler/implementation/constants.dart

Issue 11227042: isEven, isOdd, isNegative, isMaxValue, isMinValue, isInfinite, isPositive, isSingleValue. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase. Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: lib/compiler/implementation/constants.dart
diff --git a/lib/compiler/implementation/constants.dart b/lib/compiler/implementation/constants.dart
index 6c5ee532c6766dbaa64c7267e7896853ec3d45ee..4cc121d83957f97d537aa7b192bf1a246965182d 100644
--- a/lib/compiler/implementation/constants.dart
+++ b/lib/compiler/implementation/constants.dart
@@ -184,13 +184,13 @@ class IntConstant extends NumConstant {
class DoubleConstant extends NumConstant {
final double value;
factory DoubleConstant(double value) {
- if (value.isNaN()) {
+ if (value.isNaN) {
return const DoubleConstant._internal(double.NAN);
} else if (value == double.INFINITY) {
return const DoubleConstant._internal(double.INFINITY);
} else if (value == -double.INFINITY) {
return const DoubleConstant._internal(-double.INFINITY);
- } else if (value == 0.0 && !value.isNegative()) {
+ } else if (value == 0.0 && !value.isNegative) {
return const DoubleConstant._internal(0.0);
} else if (value == 1.0) {
return const DoubleConstant._internal(1.0);
@@ -200,9 +200,9 @@ class DoubleConstant extends NumConstant {
}
const DoubleConstant._internal(this.value);
bool isDouble() => true;
- bool isNaN() => value.isNaN();
+ bool isNaN() => value.isNaN;
// We need to check for the negative sign since -0.0 == 0.0.
- bool isMinusZero() => value == 0.0 && value.isNegative();
+ bool isMinusZero() => value == 0.0 && value.isNegative;
DartType computeType(Compiler compiler) {
return compiler.doubleClass.computeType(compiler);
@@ -213,9 +213,9 @@ class DoubleConstant extends NumConstant {
DoubleConstant otherDouble = other;
double otherValue = otherDouble.value;
if (value == 0.0 && otherValue == 0.0) {
- return value.isNegative() == otherValue.isNegative();
- } else if (value.isNaN()) {
- return otherValue.isNaN();
+ return value.isNegative == otherValue.isNegative;
+ } else if (value.isNaN) {
+ return otherValue.isNaN;
} else {
return value == otherValue;
}

Powered by Google App Engine
This is Rietveld 408576698