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

Unified Diff: lib/core/int.dart

Issue 10913271: Move parseInt parseDouble to int/double classes as a static method. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Make int.parse directly native. 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/core/expect.dart ('k') | lib/coreimpl/coreimpl.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/core/int.dart
diff --git a/lib/core/int.dart b/lib/core/int.dart
index 404d10a4d091f81490fc811fb50656c231802dcf..0855a62b6346bc89cb0e7dedec350eb5107e8f22 100644
--- a/lib/core/int.dart
+++ b/lib/core/int.dart
@@ -24,4 +24,20 @@ abstract class int implements num {
int floor();
int ceil();
int truncate();
+ /**
+ * Returns a representation of this [int] value.
+ *
+ * It should always be the case that if 'i' is an [int] value, then
+ * [:i == int.parse(i.toString())].
+ */
+ String toString();
+
+ /**
+ * Parse [source] as an integer literal and return its value.
+ *
+ * Accepts "0x" prefix for hexadecimal numbers, otherwise defaults
+ * to base-10.
+ * Throws a [FormatException] if [source] is not a valid integer literal.
+ */
+ external static int parse(String source);
}
« no previous file with comments | « lib/core/expect.dart ('k') | lib/coreimpl/coreimpl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698