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

Unified Diff: lib/coreimpl/date.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/coreimpl/coreimpl.dart ('k') | lib/json/json.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/coreimpl/date.dart
diff --git a/lib/coreimpl/date.dart b/lib/coreimpl/date.dart
index 140803f8634e5035285f8e05e8ba25aaa0749559..4396a8915f9fca3f36b5bf58bc6caac53a49e408 100644
--- a/lib/coreimpl/date.dart
+++ b/lib/coreimpl/date.dart
@@ -24,18 +24,18 @@ class DateImplementation implements Date {
int parseIntOrZero(String matched) {
// TODO(floitsch): we should not need to test against the empty string.
if (matched === null || matched == "") return 0;
- return parseInt(matched);
+ return int.parse(matched);
}
double parseDoubleOrZero(String matched) {
// TODO(floitsch): we should not need to test against the empty string.
if (matched === null || matched == "") return 0.0;
- return parseDouble(matched);
+ return double.parse(matched);
}
- int years = parseInt(match[1]);
- int month = parseInt(match[2]);
- int day = parseInt(match[3]);
+ int years = int.parse(match[1]);
+ int month = int.parse(match[2]);
+ int day = int.parse(match[3]);
int hour = parseIntOrZero(match[4]);
int minute = parseIntOrZero(match[5]);
int second = parseIntOrZero(match[6]);
« no previous file with comments | « lib/coreimpl/coreimpl.dart ('k') | lib/json/json.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698