| Index: runtime/lib/string.cc
|
| diff --git a/runtime/lib/string.cc b/runtime/lib/string.cc
|
| index ed1528ed18d5a175e1088820d7c93b8f898675bd..236c95da510997e4a1f34fd325e279c981ba3431 100644
|
| --- a/runtime/lib/string.cc
|
| +++ b/runtime/lib/string.cc
|
| @@ -8,6 +8,7 @@
|
| #include "vm/native_entry.h"
|
| #include "vm/object.h"
|
| #include "vm/symbols.h"
|
| +#include "vm/unicode.h"
|
|
|
| namespace dart {
|
|
|
| @@ -30,15 +31,15 @@ DEFINE_NATIVE_ENTRY(StringBase_createFromCodePoints, 1) {
|
| Exceptions::ThrowByType(Exceptions::kArgument, args);
|
| }
|
| intptr_t value = Smi::Cast(index_object).Value();
|
| - if (value < 0) {
|
| + if (Utf::IsOutOfRange(value)) {
|
| GrowableArray<const Object*> args;
|
| Exceptions::ThrowByType(Exceptions::kArgument, args);
|
| } else {
|
| - if (value > 0xFF) {
|
| + if (!Utf::IsLatin1(value)) {
|
| is_one_byte_string = false;
|
| - }
|
| - if (value > 0xFFFF) {
|
| - utf16_len += 1;
|
| + if (Utf::IsSupplementary(value)) {
|
| + utf16_len += 1;
|
| + }
|
| }
|
| }
|
| utf32_array[i] = value;
|
|
|