| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 const int _maxAscii = 0x7f; | 5 const int _maxAscii = 0x7f; |
| 6 const int _maxLatin1 = 0xff; | 6 const int _maxLatin1 = 0xff; |
| 7 const int _maxUtf16 = 0xffff; | 7 const int _maxUtf16 = 0xffff; |
| 8 const int _maxUnicode = 0x10ffff; | 8 const int _maxUnicode = 0x10ffff; |
| 9 | 9 |
| 10 @patch class String { | 10 @patch class String { |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 // For longer strings, calling into C++ to create the result of a | 76 // For longer strings, calling into C++ to create the result of a |
| 77 // [replaceAll] is faster than [_joinReplaceAllOneByteResult]. | 77 // [replaceAll] is faster than [_joinReplaceAllOneByteResult]. |
| 78 // TODO(lrn): See if this limit can be tweaked. | 78 // TODO(lrn): See if this limit can be tweaked. |
| 79 static const int _maxJoinReplaceOneByteStringLength = 500; | 79 static const int _maxJoinReplaceOneByteStringLength = 500; |
| 80 | 80 |
| 81 factory _StringBase._uninstantiable() { | 81 factory _StringBase._uninstantiable() { |
| 82 throw new UnsupportedError( | 82 throw new UnsupportedError( |
| 83 "_StringBase can't be instaniated"); | 83 "_StringBase can't be instaniated"); |
| 84 } | 84 } |
| 85 | 85 |
| 86 Type get runtimeType => String; | |
| 87 | |
| 88 int get hashCode native "String_getHashCode"; | 86 int get hashCode native "String_getHashCode"; |
| 89 | 87 |
| 90 bool get _isOneByte { | 88 bool get _isOneByte { |
| 91 // Alternatively return false and override it on one-byte string classes. | 89 // Alternatively return false and override it on one-byte string classes. |
| 92 int id = ClassID.getID(this); | 90 int id = ClassID.getID(this); |
| 93 return id == ClassID.cidOneByteString || | 91 return id == ClassID.cidOneByteString || |
| 94 id == ClassID.cidExternalOneByteString; | 92 id == ClassID.cidExternalOneByteString; |
| 95 } | 93 } |
| 96 | 94 |
| 97 /** | 95 /** |
| (...skipping 1261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1359 int end = index + _pattern.length; | 1357 int end = index + _pattern.length; |
| 1360 _current = new _StringMatch(index, _input, _pattern); | 1358 _current = new _StringMatch(index, _input, _pattern); |
| 1361 // Empty match, don't start at same location again. | 1359 // Empty match, don't start at same location again. |
| 1362 if (end == _index) end++; | 1360 if (end == _index) end++; |
| 1363 _index = end; | 1361 _index = end; |
| 1364 return true; | 1362 return true; |
| 1365 } | 1363 } |
| 1366 | 1364 |
| 1367 Match get current => _current; | 1365 Match get current => _current; |
| 1368 } | 1366 } |
| OLD | NEW |