Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(223)

Unified Diff: runtime/vm/dart_api_impl.cc

Issue 11368138: Add some support for the code-point code-unit distinction. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: New version integrates feedback, adds less to standard String class. Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: runtime/vm/dart_api_impl.cc
diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc
index c69f875919ec8ad09f5cc869a90c2b097dc8965c..f87b47b416d2d69449182bb717961aa4fcc8b6d3 100644
--- a/runtime/vm/dart_api_impl.cc
+++ b/runtime/vm/dart_api_impl.cc
@@ -1703,7 +1703,7 @@ DART_EXPORT Dart_Handle Dart_StringToUTF16(Dart_Handle str,
intptr_t str_len = str_obj.Length();
intptr_t copy_len = (str_len > *length) ? *length : str_len;
for (intptr_t i = 0; i < copy_len; i++) {
- utf16_array[i] = static_cast<uint16_t>(str_obj.CharAt(i));
+ utf16_array[i] = static_cast<uint16_t>(str_obj.CodeUnitAt(i));
}
*length = copy_len;
return Api::Success(isolate);
@@ -2601,7 +2601,7 @@ DART_EXPORT Dart_Handle Dart_ClassGetFunctionTypeSignature(Dart_Handle clazz) {
// Outside of the vm, we expose setter names with a trailing '='.
static bool HasExternalSetterSuffix(const String& name) {
- return name.CharAt(name.Length() - 1) == '=';
+ return name.CodeUnitAt(name.Length() - 1) == '=';
}

Powered by Google App Engine
This is Rietveld 408576698