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

Unified Diff: runtime/lib/double_patch.dart

Issue 11783009: Big merge from experimental to bleeding edge. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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 | « runtime/lib/double.dart ('k') | runtime/lib/expando_patch.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/double_patch.dart
diff --git a/runtime/lib/double_patch.dart b/runtime/lib/double_patch.dart
index 5e6cc110da2e1d26248e57b5bcbe10a0c1be76ab..e56f45dc74c234ef81628d2bb72d63c120c5c409 100644
--- a/runtime/lib/double_patch.dart
+++ b/runtime/lib/double_patch.dart
@@ -6,6 +6,15 @@
// VM implementation of double.
patch class double {
- /* patch */
- static double parse(String string) native "Double_parse";
+ static double _parse(String string) native "Double_parse";
+
+ /* patch */ static double parse(String str,
+ [double handleError(String str)]) {
+ if (handleError == null) return _parse(str);
+ try {
+ return _parse(str);
+ } on FormatException {
+ return handleError(str);
+ }
+ }
}
« no previous file with comments | « runtime/lib/double.dart ('k') | runtime/lib/expando_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698