Skip to content

Commit ff6fb9d

Browse files
committed
Fix 110,127 @lrhn
1 parent 91f53c5 commit ff6fb9d

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

sdk/lib/core/bool.dart

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -96,18 +96,16 @@ class bool {
9696

9797
/// Parse [source] as an, optionally case-insensitive, boolean literal.
9898
///
99-
/// If [caseSensitive] is `true`, which is the default,
99+
/// If [caseSensitive] is `true`, which is the default,
100100
/// the only accepted inputs are the strings `"true"` and `"false"`.
101-
/// If [caseSensitive] is `false`, any combination of upper and lower case ASCII letters
101+
/// If [caseSensitive] is `false`, any combination of upper and lower case ASCII letters
102102
/// in the words `"true"` and `"false"` are accepted, as if the input was first lower-cased.
103103
///
104-
/// If the [source] string does not contain a valid boolean literal
104+
/// If the [source] string does not contain a valid boolean literal
105105
/// a [FormatException] is thrown.
106106
///
107107
/// Rather than throwing and immediately catching the [FormatException],
108108
/// instead use [tryParse] to handle a potential parsing error.
109-
///
110-
/// ```
111109
external static bool parse(String source, {bool? caseSensitive});
112110

113111
/// Parse [source] as an, optionally case-insensitive, boolean literal.
@@ -121,14 +119,13 @@ class bool {
121119
/// print(int.tryParse('TRUE')); // true
122120
/// print(int.tryParse('false', caseSensitive: true)); // false
123121
/// print(int.tryParse('FALSE', caseSensitive: true)); // false
124-
/// print(int.tryParse('NO')); // FormatException
125-
/// print(int.tryParse('YES')); // FormatException
126-
/// print(int.tryParse('0')); // FormatException
127-
/// print(int.tryParse('1')); // FormatException
122+
/// print(int.tryParse('NO')); // null
123+
/// print(int.tryParse('YES')); // null
124+
/// print(int.tryParse('0')); // null
125+
/// print(int.tryParse('1')); // null
128126
/// ```
129127
external static bool? tryParse(String source, {bool? caseSensitive});
130128

131-
132129
external int get hashCode;
133130

134131
/// The logical conjunction ("and") of this and [other].

0 commit comments

Comments
 (0)