Index: sdk/lib/_internal/compiler/implementation/lib/string_helper.dart |
diff --git a/sdk/lib/_internal/compiler/implementation/lib/string_helper.dart b/sdk/lib/_internal/compiler/implementation/lib/string_helper.dart |
index 9e2781143417016b136cec3a55cfd62478afc20a..cb8033d6aa402aa4f8b42f50e2d4ead4e9af895b 100644 |
--- a/sdk/lib/_internal/compiler/implementation/lib/string_helper.dart |
+++ b/sdk/lib/_internal/compiler/implementation/lib/string_helper.dart |
@@ -145,10 +145,10 @@ stringReplaceAllEmptyFuncUnchecked(receiver, onMatch, onNonMatch) { |
while (i < length) { |
buffer.add(onMatch(new StringMatch(i, receiver, ""))); |
// Special case to avoid splitting a surrogate pair. |
- int code = receiver.charCodeAt(i); |
+ int code = receiver.codeUnitAt(i); |
if ((code & ~0x3FF) == 0xD800 && length > i + 1) { |
// Leading surrogate; |
- code = receiver.charCodeAt(i + 1); |
+ code = receiver.codeUnitAt(i + 1); |
if ((code & ~0x3FF) == 0xDC00) { |
// Matching trailing surrogate. |
buffer.add(onNonMatch(receiver.substring(i, i + 2))); |