Skip to content

Commit 0ae26d8

Browse files
committed
Reorder isSurrogatePair
1 parent 2606492 commit 0ae26d8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pkgs/html/lib/src/html_input_stream.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,9 @@ class HtmlInputStream {
107107
}
108108
}
109109

110-
final isSurrogatePair =
111-
i + 1 < charsLength && _isLeadSurrogate(c) && _isTrailSurrogate(rawChars[i + 1]);
110+
final isSurrogatePair = _isLeadSurrogate(c) &&
111+
i + 1 < charsLength &&
112+
_isTrailSurrogate(rawChars[i + 1]);
112113
if (!isSurrogatePair && !wasSurrogatePair) {
113114
if (_invalidUnicode(c)) {
114115
errors.add('invalid-codepoint');

0 commit comments

Comments
 (0)