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

Unified Diff: runtime/lib/integers.dart

Issue 8528050: Fix throwing ObjectNotClosure instead of null exception if closure is null. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years, 1 month 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
« no previous file with comments | « corelib/src/expect.dart ('k') | runtime/vm/code_generator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/integers.dart
===================================================================
--- runtime/lib/integers.dart (revision 1537)
+++ runtime/lib/integers.dart (working copy)
@@ -92,10 +92,19 @@
bool isInfinite() { return false; }
int compareTo(Comparable other) {
- if (this == other) return 0;
- if (this < other) return -1;
- return 1;
+ final int EQUAL = 0, LESS = -1, GREATER = 1;
+ if (this < other) {
+ return LESS;
+ } else if (this > other) {
+ return GREATER;
+ } else if (this == other) {
+ return EQUAL;
+ } else {
+ // Other is NaN.
+ return LESS;
+ }
}
+
int round() { return this; }
int floor() { return this; }
int ceil() { return this; }
« no previous file with comments | « corelib/src/expect.dart ('k') | runtime/vm/code_generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698