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

Side by Side Diff: compiler/lib/implementation/number.dart

Issue 9192007: Simplify equality checks and get rid of unreachable code in number and bool. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 11 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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 NumberImplementation implements int, double native "Number" { 5 class NumberImplementation implements int, double native "Number" {
6
6 NumberImplementation operator +(NumberImplementation other) native; 7 NumberImplementation operator +(NumberImplementation other) native;
7 NumberImplementation operator -(NumberImplementation other) native; 8 NumberImplementation operator -(NumberImplementation other) native;
8 NumberImplementation operator *(NumberImplementation other) native; 9 NumberImplementation operator *(NumberImplementation other) native;
9 NumberImplementation operator /(NumberImplementation other) native; 10 NumberImplementation operator /(NumberImplementation other) native;
10 NumberImplementation operator ~/(NumberImplementation other) native; 11 NumberImplementation operator ~/(NumberImplementation other) native;
11 NumberImplementation operator %(NumberImplementation shiftAmount) native; 12 NumberImplementation operator %(NumberImplementation shiftAmount) native;
12 NumberImplementation operator negate() native; 13 NumberImplementation operator negate() native;
14
13 int operator |(int other) native; 15 int operator |(int other) native;
14 int operator &(int other) native; 16 int operator &(int other) native;
15 int operator ^(int other) native; 17 int operator ^(int other) native;
16 int operator <<(int shiftAmount) native; 18 int operator <<(int shiftAmount) native;
17 int operator >>(int shiftAmount) native; 19 int operator >>(int shiftAmount) native;
18 int operator ~() native; 20 int operator ~() native;
21
19 bool operator ==(NumberImplementation other) native; 22 bool operator ==(NumberImplementation other) native;
20 bool operator <(NumberImplementation other) native; 23 bool operator <(NumberImplementation other) native;
21 bool operator <=(NumberImplementation other) native; 24 bool operator <=(NumberImplementation other) native;
22 bool operator >(NumberImplementation other) native; 25 bool operator >(NumberImplementation other) native;
23 bool operator >=(NumberImplementation other) native; 26 bool operator >=(NumberImplementation other) native;
24 27
25
26 NumberImplementation remainder(num other) native; 28 NumberImplementation remainder(num other) native;
27 NumberImplementation abs() native; 29 NumberImplementation abs() native;
28 NumberImplementation round() native; 30 NumberImplementation round() native;
29 NumberImplementation floor() native; 31 NumberImplementation floor() native;
30 NumberImplementation ceil() native; 32 NumberImplementation ceil() native;
31 NumberImplementation truncate() native; 33 NumberImplementation truncate() native;
32 34
33 // CompareTo has to give a complete order, including -0/+0, NaN and 35 // CompareTo has to give a complete order, including -0/+0, NaN and
34 // Infinities. 36 // Infinities.
35 // Order is: -Inf < .. < -0.0 < 0.0 .. < +inf < NaN. 37 // Order is: -Inf < .. < -0.0 < 0.0 .. < +inf < NaN.
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 88
87 int hashCode() native; 89 int hashCode() native;
88 get dynamic() { return toDouble(); } 90 get dynamic() { return toDouble(); }
89 } 91 }
90 92
91 class _NumberJsUtil { 93 class _NumberJsUtil {
92 static void _throwIllegalArgumentException(var argument) native { 94 static void _throwIllegalArgumentException(var argument) native {
93 throw new IllegalArgumentException([argument]); 95 throw new IllegalArgumentException([argument]);
94 } 96 }
95 } 97 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698