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

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

Issue 25674017: Fix runtimeType for strings, integers and double: return their interface type. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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
« no previous file with comments | « no previous file | runtime/lib/integers.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
9 Type get runtimeType => double;
10
8 int get _identityHashCode { 11 int get _identityHashCode {
9 if (isNaN || isInfinite) return 0; 12 if (isNaN || isInfinite) return 0;
10 return toInt(); 13 return toInt();
11 } 14 }
12 double operator +(num other) { 15 double operator +(num other) {
13 return _add(other.toDouble()); 16 return _add(other.toDouble());
14 } 17 }
15 double _add(double other) native "Double_add"; 18 double _add(double other) native "Double_add";
16 19
17 double operator -(num other) { 20 double operator -(num other) {
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 return EQUAL; 229 return EQUAL;
227 } 230 }
228 } else if (isNaN) { 231 } else if (isNaN) {
229 return other.isNaN ? EQUAL : GREATER; 232 return other.isNaN ? EQUAL : GREATER;
230 } else { 233 } else {
231 // Other is NaN. 234 // Other is NaN.
232 return LESS; 235 return LESS;
233 } 236 }
234 } 237 }
235 } 238 }
OLDNEW
« no previous file with comments | « no previous file | runtime/lib/integers.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698