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

Unified Diff: lib/json/json.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/date.dart ('k') | lib/math/base.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/json/json.dart
diff --git a/lib/json/json.dart b/lib/json/json.dart
index ac1fb5fc6ec750a03baf19719c01930360c75e3f..be26c011c7b4e81d6f1c7309d4aa3dc7fee035ee 100644
--- a/lib/json/json.dart
+++ b/lib/json/json.dart
@@ -331,7 +331,7 @@ class _JsonParser {
}
final codeString = json.substring(position + 1, position + 5);
try {
- c = parseInt('0x${codeString}');
+ c = int.parse('0x${codeString}');
} catch (e) {
error('Invalid unicode esacape sequence');
}
@@ -389,9 +389,9 @@ class _JsonParser {
String number = json.substring(startPos, position);
if (isInt) {
- return parseInt(number);
+ return int.parse(number);
} else {
- return parseDouble(number);
+ return double.parse(number);
}
}
« no previous file with comments | « lib/coreimpl/date.dart ('k') | lib/math/base.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698