Chromium Code Reviews| Index: sdk/lib/_internal/lib/js_number.dart |
| diff --git a/sdk/lib/_internal/lib/js_number.dart b/sdk/lib/_internal/lib/js_number.dart |
| index b6606f0699d05bc69b78691e46792946ac2ba618..7aaeb9369e78d33e73bd942db52a1188101ddcff 100644 |
| --- a/sdk/lib/_internal/lib/js_number.dart |
| +++ b/sdk/lib/_internal/lib/js_number.dart |
| @@ -59,6 +59,8 @@ class JSNumber extends Interceptor implements num { |
| num abs() => JS('num', r'Math.abs(#)', this); |
| + num get sign => this > 0 ? 1 : this < 0 ? -1 : this; |
|
Søren Gjesse
2013/12/13 11:45:04
EcmaScript 6 has Math.sign with the same semantics
Lasse Reichstein Nielsen
2013/12/13 12:08:48
Interesting. Did not know that.
Since it most like
|
| + |
| static const int _MIN_INT32 = -0x80000000; |
| static const int _MAX_INT32 = 0x7FFFFFFF; |
| @@ -240,7 +242,7 @@ class JSNumber extends Interceptor implements num { |
| } |
| num operator >>(num other) { |
| - if (false) _shrReceiverPositive(other); |
| + if (false) _shrReceiverPositive(other); |
|
sra1
2014/03/07 00:53:35
What is the purpose of this dead code?
Please dele
|
| if (other is !num) throw new ArgumentError(other); |
| if (JS('num', '#', other) < 0) throw new ArgumentError(other); |
| return _shrOtherPositive(other); |