Chromium Code Reviews| Index: sdk/lib/core/int.dart |
| diff --git a/sdk/lib/core/int.dart b/sdk/lib/core/int.dart |
| index 681b8e8815a4f0f166fbc22c51cf92de08d781a9..a8f9862db5b78f12dde1aa8d25bc9c5ac03be531 100644 |
| --- a/sdk/lib/core/int.dart |
| +++ b/sdk/lib/core/int.dart |
| @@ -277,6 +277,12 @@ abstract class int extends num { |
| * value is used instead. If no [onError] is provided, a [FormatException] |
| * is thrown. |
| * |
| + * The [onError] handler may return `null`. This is preferable to catching |
|
Lasse Reichstein Nielsen
2015/03/06 13:06:52
The [onError] handler can be chosen to return `nul
sra1
2015/03/06 21:38:39
Done.
|
| + * the [FormatException], for example: |
| + * |
| + * var value = int.parse(text, onError: (source) => null); |
| + * if (value == null) ... handle the |
| + * |
| * The [onError] function is only invoked if [source] is a [String]. It is |
| * not invoked if the [source] is, for example, `null`. |
| */ |