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 extends _Num { |
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 | 12 |
13 Type get runtimeType => int; | 13 Type get runtimeType => int; |
14 | 14 |
15 num operator +(num other) { | 15 num operator +(num other) { |
16 return other._addFromInteger(this); | 16 return other._addFromInteger(this); |
17 } | 17 } |
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
467 } else { | 467 } else { |
468 return 0; | 468 return 0; |
469 } | 469 } |
470 } | 470 } |
471 int _shlFromInt(int other) native "Bigint_shlFromInt"; | 471 int _shlFromInt(int other) native "Bigint_shlFromInt"; |
472 | 472 |
473 int pow(int exponent) { | 473 int pow(int exponent) { |
474 throw "Bigint.pow not implemented"; | 474 throw "Bigint.pow not implemented"; |
475 } | 475 } |
476 } | 476 } |
OLD | NEW |