Index: sdk/lib/core/num.dart |
diff --git a/sdk/lib/core/num.dart b/sdk/lib/core/num.dart |
index 38587b107abf2b08582079c866f1e8df940f1d2d..b62fa2dacc71334f82930b2ad3c8acf2a77fa023 100644 |
--- a/sdk/lib/core/num.dart |
+++ b/sdk/lib/core/num.dart |
@@ -439,14 +439,15 @@ abstract class num implements Comparable<num> { |
static num parse(String input, [num onError(String input)]) { |
String source = input.trim(); |
// TODO(lrn): Optimize to detect format and result type in one check. |
- num result = int.parse(source, onError: _returnNull); |
+ num result = int.parse(source, onError: _returnIntNull); |
if (result != null) return result; |
- result = double.parse(source, _returnNull); |
+ result = double.parse(source, _returnDoubleNull); |
if (result != null) return result; |
if (onError == null) throw new FormatException(input); |
return onError(input); |
} |
/** Helper function for [parse]. */ |
Lasse Reichstein Nielsen
2016/04/16 09:58:22
functions
floitsch
2016/04/19 15:36:39
Done.
|
- static _returnNull(_) => null; |
+ static int _returnIntNull(String _) => null; |
+ static double _returnDoubleNull(String _) => null; |
} |