| Index: runtime/lib/integers.dart
|
| ===================================================================
|
| --- runtime/lib/integers.dart (revision 1806)
|
| +++ runtime/lib/integers.dart (working copy)
|
| @@ -5,6 +5,10 @@
|
| // TODO(srdjan): fix limitations.
|
| // - shift amount must be a Smi.
|
| class IntegerImplementation {
|
| + factory IntegerImplementation._uninstantiable() {
|
| + throw const UnsupportedOperationException(
|
| + "IntegerImplementation can only be allocated by the VM");
|
| + }
|
| num operator +(num other) {
|
| return other.addFromInteger(this);
|
| }
|
| @@ -156,6 +160,10 @@
|
| }
|
|
|
| class Smi extends IntegerImplementation implements int {
|
| + factory Smi._uninstantiable() {
|
| + throw const UnsupportedOperationException(
|
| + "Smi can only be allocated by the VM");
|
| + }
|
| int hashCode() {
|
| return this;
|
| }
|
| @@ -166,6 +174,10 @@
|
|
|
| // Represents integers that cannot be represented by Smi but fit into 64bits.
|
| class Mint extends IntegerImplementation implements int {
|
| + factory Mint._uninstantiable() {
|
| + throw const UnsupportedOperationException(
|
| + "Mint can only be allocated by the VM");
|
| + }
|
| int hashCode() {
|
| return this;
|
| }
|
| @@ -175,6 +187,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() {
|
| + throw const UnsupportedOperationException(
|
| + "Bigint can only be allocated by the VM");
|
| + }
|
| int hashCode() {
|
| return this;
|
| }
|
|
|