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

Side by Side Diff: runtime/lib/double.dart

Issue 11191078: Make hashCode a getter and not a method. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update status file with co19 issue number. 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 class _Double implements double { 5 class _Double implements double {
6 factory _Double.fromInteger(int value) 6 factory _Double.fromInteger(int value)
7 native "Double_doubleFromInteger"; 7 native "Double_doubleFromInteger";
8 int hashCode() { 8 int get hashCode {
9 try { 9 try {
10 return toInt(); 10 return toInt();
11 } on FormatException catch (e) { 11 } on FormatException catch (e) {
12 return 0; 12 return 0;
13 } 13 }
14 } 14 }
15 double operator +(num other) { 15 double operator +(num other) {
16 return _add(other.toDouble()); 16 return _add(other.toDouble());
17 } 17 }
18 double _add(double other) native "Double_add"; 18 double _add(double other) native "Double_add";
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 return EQUAL; 221 return EQUAL;
222 } 222 }
223 } else if (isNaN()) { 223 } else if (isNaN()) {
224 return other.isNaN() ? EQUAL : GREATER; 224 return other.isNaN() ? EQUAL : GREATER;
225 } else { 225 } else {
226 // Other is NaN. 226 // Other is NaN.
227 return LESS; 227 return LESS;
228 } 228 }
229 } 229 }
230 } 230 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698