Index: runtime/lib/string_patch.dart |
=================================================================== |
--- runtime/lib/string_patch.dart (revision 37566) |
+++ runtime/lib/string_patch.dart (working copy) |
@@ -54,7 +54,7 @@ |
static String createFromCharCodes(Iterable<int> charCodes) { |
if (charCodes != null) { |
// TODO(srdjan): Also skip copying of wide typed arrays. |
- final ccid = charCodes._cid; |
+ final ccid = ClassID.getID(charCodes); |
bool isOneByteString = false; |
if ((ccid != _List._classId) && |
(ccid != _GrowableList._classId) && |
@@ -510,7 +510,7 @@ |
int totalLength = 0; |
for (int i = 0; i < numValues; i++) { |
var s = values[i].toString(); |
- if (isOneByteString && (s._cid == _OneByteString._classId)) { |
+ if (isOneByteString && (ClassID.getID(s) == _OneByteString._classId)) { |
totalLength += s.length; |
} else { |
isOneByteString = false; |
@@ -625,7 +625,7 @@ |
class _OneByteString extends _StringBase implements String { |
- static final int _classId = "A"._cid; |
+ static final int _classId = ClassID.getID("A"); |
factory _OneByteString._uninstantiable() { |
throw new UnsupportedError( |
@@ -649,7 +649,8 @@ |
native "OneByteString_splitWithCharCode"; |
List<String> split(Pattern pattern) { |
- if ((pattern._cid == _OneByteString._classId) && (pattern.length == 1)) { |
+ if ((ClassID.getID(pattern) == _OneByteString._classId) && |
+ (pattern.length == 1)) { |
return _splitWithCharCode(pattern.codeUnitAt(0)); |
} |
return super.split(pattern); |
@@ -677,7 +678,7 @@ |
int indexOf(Pattern pattern, [int start = 0]) { |
// Specialize for single character pattern. |
- final pCid = pattern._cid; |
+ final pCid = ClassID.getID(pattern); |
if ((pCid == _OneByteString._classId) || |
(pCid == _TwoByteString._classId) || |
(pCid == _ExternalOneByteString._classId)) { |
@@ -699,7 +700,7 @@ |
} |
bool contains(Pattern pattern, [int start = 0]) { |
- final pCid = pattern._cid; |
+ final pCid = ClassID.getID(pattern); |
if ((pCid == _OneByteString._classId) || |
(pCid == _TwoByteString._classId) || |
(pCid == _ExternalOneByteString._classId)) { |
@@ -736,7 +737,7 @@ |
} |
String padLeft(int width, [String padding = ' ']) { |
- int padCid = padding._cid; |
+ int padCid = ClassID.getID(padding); |
if (padCid != _OneByteString._classId && |
padCid != _ExternalOneByteString._classId) { |
return super.padLeft(width, padding); |
@@ -767,7 +768,7 @@ |
} |
String padRight(int width, [String padding = ' ']) { |
- int padCid = padding._cid; |
+ int padCid = ClassID.getID(padding); |
if (padCid != _OneByteString._classId && |
padCid != _ExternalOneByteString._classId) { |
return super.padRight(width, padding); |
@@ -906,7 +907,7 @@ |
class _TwoByteString extends _StringBase implements String { |
- static final int _classId = "\u{FFFF}"._cid; |
+ static final int _classId = ClassID.getID("\u{FFFF}"); |
factory _TwoByteString._uninstantiable() { |
throw new UnsupportedError( |