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

Unified Diff: vm/object.cc

Issue 11411341: Fix for issue 7089 (Symbols::New was not quite working correctly (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years 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
« no previous file with comments | « vm/object.h ('k') | vm/object_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/object.cc
===================================================================
--- vm/object.cc (revision 15671)
+++ vm/object.cc (working copy)
@@ -10051,17 +10051,17 @@
}
-RawString* String::New(const char* str, Heap::Space space) {
- ASSERT(str != NULL);
- intptr_t array_len = strlen(str);
- const uint8_t* utf8_array = reinterpret_cast<const uint8_t*>(str);
- return String::New(utf8_array, array_len, space);
+RawString* String::New(const char* cstr, Heap::Space space) {
+ ASSERT(cstr != NULL);
+ intptr_t array_len = strlen(cstr);
+ const uint8_t* utf8_array = reinterpret_cast<const uint8_t*>(cstr);
+ return String::FromUTF8(utf8_array, array_len, space);
}
-RawString* String::New(const uint8_t* utf8_array,
- intptr_t array_len,
- Heap::Space space) {
+RawString* String::FromUTF8(const uint8_t* utf8_array,
+ intptr_t array_len,
+ Heap::Space space) {
Utf8::Type type;
intptr_t len = Utf8::CodeUnitCount(utf8_array, array_len, &type);
if (type == Utf8::kLatin1) {
@@ -10082,6 +10082,13 @@
}
+RawString* String::New(const uint8_t* latin1_array,
+ intptr_t array_len,
+ Heap::Space space) {
+ return OneByteString::New(latin1_array, array_len, space);
+}
+
+
RawString* String::New(const uint16_t* utf16_array,
intptr_t array_len,
Heap::Space space) {
« no previous file with comments | « vm/object.h ('k') | vm/object_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698