Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(908)

Unified Diff: lib/integers.dart

Issue 10918213: - Move double and int implementations into dart:core and make them private. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/double.dart ('k') | lib/lib_impl_sources.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « lib/double.dart ('k') | lib/lib_impl_sources.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698