| Index: lib/integers.dart
|
| ===================================================================
|
| --- lib/integers.dart (revision 12304)
|
| +++ lib/integers.dart (working copy)
|
| @@ -4,10 +4,10 @@
|
|
|
| // TODO(srdjan): fix limitations.
|
| // - shift amount must be a Smi.
|
| -class IntegerImplementation {
|
| - factory IntegerImplementation._uninstantiable() {
|
| +class _IntegerImplementation {
|
| + factory _IntegerImplementation._uninstantiable() {
|
| throw const UnsupportedOperationException(
|
| - "IntegerImplementation can only be allocated by the VM");
|
| + "_IntegerImplementation can only be allocated by the VM");
|
| }
|
| num operator +(num other) {
|
| return other.addFromInteger(this);
|
| @@ -132,13 +132,13 @@
|
| int truncate() { return this; }
|
|
|
| int toInt() { return this; }
|
| - double toDouble() { return new Double.fromInteger(this); }
|
| + double toDouble() { return new _Double.fromInteger(this); }
|
|
|
| int pow(int exponent) {
|
| double res = this.toDouble().pow(exponent);
|
| if (res.isInfinite()) {
|
| // Use Bigint instead.
|
| - throw "IntegerImplementation.pow not implemented for large integers.";
|
| + throw "_IntegerImplementation.pow not implemented for large integers.";
|
| }
|
| return res.toInt();
|
| }
|
| @@ -178,10 +178,10 @@
|
| }
|
| }
|
|
|
| -class Smi extends IntegerImplementation implements int {
|
| - factory Smi._uninstantiable() {
|
| +class _Smi extends _IntegerImplementation implements int {
|
| + factory _Smi._uninstantiable() {
|
| throw const UnsupportedOperationException(
|
| - "Smi can only be allocated by the VM");
|
| + "_Smi can only be allocated by the VM");
|
| }
|
| int hashCode() {
|
| return this;
|
| @@ -192,10 +192,10 @@
|
| }
|
|
|
| // Represents integers that cannot be represented by Smi but fit into 64bits.
|
| -class Mint extends IntegerImplementation implements int {
|
| - factory Mint._uninstantiable() {
|
| +class _Mint extends _IntegerImplementation implements int {
|
| + factory _Mint._uninstantiable() {
|
| throw const UnsupportedOperationException(
|
| - "Mint can only be allocated by the VM");
|
| + "_Mint can only be allocated by the VM");
|
| }
|
| int hashCode() {
|
| return this;
|
| @@ -217,10 +217,10 @@
|
|
|
| // A number that can be represented as Smi or Mint will never be represented as
|
| // Bigint.
|
| -class Bigint extends IntegerImplementation implements int {
|
| - factory Bigint._uninstantiable() {
|
| +class _Bigint extends _IntegerImplementation implements int {
|
| + factory _Bigint._uninstantiable() {
|
| throw const UnsupportedOperationException(
|
| - "Bigint can only be allocated by the VM");
|
| + "_Bigint can only be allocated by the VM");
|
| }
|
| int hashCode() {
|
| return this;
|
|
|