| OLD | NEW |
| 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 // TODO(srdjan): fix limitations. | 5 // TODO(srdjan): fix limitations. |
| 6 // - shift amount must be a Smi. | 6 // - shift amount must be a Smi. |
| 7 class _IntegerImplementation { | 7 class _IntegerImplementation { |
| 8 factory _IntegerImplementation._uninstantiable() { | 8 factory _IntegerImplementation._uninstantiable() { |
| 9 throw new UnsupportedError( | 9 throw new UnsupportedError( |
| 10 "_IntegerImplementation can only be allocated by the VM"); | 10 "_IntegerImplementation can only be allocated by the VM"); |
| 11 } | 11 } |
| 12 |
| 13 Type get runtimeType => int; |
| 14 |
| 12 num operator +(num other) { | 15 num operator +(num other) { |
| 13 return other._addFromInteger(this); | 16 return other._addFromInteger(this); |
| 14 } | 17 } |
| 15 num operator -(num other) { | 18 num operator -(num other) { |
| 16 return other._subFromInteger(this); | 19 return other._subFromInteger(this); |
| 17 } | 20 } |
| 18 num operator *(num other) { | 21 num operator *(num other) { |
| 19 return other._mulFromInteger(this); | 22 return other._mulFromInteger(this); |
| 20 } | 23 } |
| 21 num operator ~/(num other) { | 24 num operator ~/(num other) { |
| (...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 } else { | 333 } else { |
| 331 return 0; | 334 return 0; |
| 332 } | 335 } |
| 333 } | 336 } |
| 334 int _shlFromInt(int other) native "Bigint_shlFromInt"; | 337 int _shlFromInt(int other) native "Bigint_shlFromInt"; |
| 335 | 338 |
| 336 int pow(int exponent) { | 339 int pow(int exponent) { |
| 337 throw "Bigint.pow not implemented"; | 340 throw "Bigint.pow not implemented"; |
| 338 } | 341 } |
| 339 } | 342 } |
| OLD | NEW |