Index: runtime/lib/convert_patch.dart |
diff --git a/runtime/lib/convert_patch.dart b/runtime/lib/convert_patch.dart |
index d5683e11f87ee093796388d968bb3e95a2f75da4..8dc448423942594ae253b7815875bc07177d4790 100644 |
--- a/runtime/lib/convert_patch.dart |
+++ b/runtime/lib/convert_patch.dart |
@@ -558,14 +558,14 @@ class _JsonParser { |
listener.handleNumber(intSign * intValue); |
return position; |
} |
- // Consider whether we can have an int/double.parse that works on part of |
- // a string, to avoid creating the substring. |
- String literal = source.substring(start, position); |
// This correctly creates -0.0 for doubles. |
- listener.handleNumber(double.parse(literal)); |
+ listener.handleNumber(_parseDouble(source, start, position)); |
return position; |
} |
+ static double _parseDouble(String str, |
+ int start, int end) native "Double_parse"; |
+ |
void fail(int position, [String message]) { |
if (message == null) message = "Unexpected character"; |
listener.fail(source, position, message); |