Chromium Code Reviews| Index: runtime/lib/string_patch.dart |
| diff --git a/runtime/lib/string_patch.dart b/runtime/lib/string_patch.dart |
| index 0550ca77a32c68c5aa44e5187f078ffc73db1958..3b66d59248855c8b3090ca4940c7486ff21a69ec 100644 |
| --- a/runtime/lib/string_patch.dart |
| +++ b/runtime/lib/string_patch.dart |
| @@ -260,9 +260,9 @@ class _StringBase { |
| static bool _isOneByteWhitespace(int codePoint) { |
| return |
| (codePoint == 32) || // Space. |
| - ((9 <= codePoint) && (codePoint <= 13)) || // CR, LF, TAB, etc. |
| - (codePoint == 0x85) || // NEL |
| - (codePoint == 0xA0); // NBSP |
| + ((codePoint <= 13) ? (9 <= codePoint) // CR, LF, TAB, etc. |
| + : ((codePoint == 0x85) || // NEL |
|
floitsch
2014/07/17 11:35:06
indentation
Lasse Reichstein Nielsen
2014/07/18 07:43:09
Done.
|
| + (codePoint == 0xA0))); // NBSP |
| } |
| // Characters with Whitespace property (Unicode 6.2). |
| @@ -281,16 +281,17 @@ class _StringBase { |
| // |
| // BOM: 0xFEFF |
| static bool _isTwoByteWhitespace(int codeUnit) { |
| - if (codeUnit < 256) return _isOneByteWhitespace(codeUnit); |
| - return (codeUnit == 0x1680) || |
| - (codeUnit == 0x180E) || |
| - ((0x2000 <= codeUnit) && (codeUnit <= 0x200A)) || |
| - (codeUnit == 0x2028) || |
| - (codeUnit == 0x2029) || |
| - (codeUnit == 0x202F) || |
| - (codeUnit == 0x205F) || |
| - (codeUnit == 0x3000) || |
| - (codeUnit == 0xFEFF); |
| + if (codeUnit <= 0xA0) return _isOneByteWhitespace(codeUnit); |
| + return (codeUnit <= 0x200A) |
| + ? ((codeUnit == 0x1680) || |
| + (codeUnit == 0x180E) || |
| + (0x2000 <= codeUnit)) |
| + : ((codeUnit == 0x2028) || |
| + (codeUnit == 0x2029) || |
| + (codeUnit == 0x202F) || |
| + (codeUnit == 0x205F) || |
| + (codeUnit == 0x3000) || |
| + (codeUnit == 0xFEFF)); |
| } |
| int _firstNonWhitespace() { |