| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/bootstrap_natives.h" | 5 #include "vm/bootstrap_natives.h" |
| 6 | 6 |
| 7 #include "vm/exceptions.h" | 7 #include "vm/exceptions.h" |
| 8 #include "vm/native_entry.h" | 8 #include "vm/native_entry.h" |
| 9 #include "vm/object.h" | 9 #include "vm/object.h" |
| 10 #include "vm/symbols.h" | 10 #include "vm/symbols.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 if (!index_object.IsSmi()) { | 27 if (!index_object.IsSmi()) { |
| 28 GrowableArray<const Object*> args; | 28 GrowableArray<const Object*> args; |
| 29 args.Add(&index_object); | 29 args.Add(&index_object); |
| 30 Exceptions::ThrowByType(Exceptions::kArgument, args); | 30 Exceptions::ThrowByType(Exceptions::kArgument, args); |
| 31 } | 31 } |
| 32 intptr_t value = Smi::Cast(index_object).Value(); | 32 intptr_t value = Smi::Cast(index_object).Value(); |
| 33 if (value < 0) { | 33 if (value < 0) { |
| 34 GrowableArray<const Object*> args; | 34 GrowableArray<const Object*> args; |
| 35 Exceptions::ThrowByType(Exceptions::kArgument, args); | 35 Exceptions::ThrowByType(Exceptions::kArgument, args); |
| 36 } else { | 36 } else { |
| 37 if (value > 0x7F) { | 37 if (value > 0xFF) { |
| 38 is_one_byte_string = false; | 38 is_one_byte_string = false; |
| 39 } | 39 } |
| 40 if (value > 0xFFFF) { | 40 if (value > 0xFFFF) { |
| 41 utf16_len += 1; | 41 utf16_len += 1; |
| 42 } | 42 } |
| 43 } | 43 } |
| 44 utf32_array[i] = value; | 44 utf32_array[i] = value; |
| 45 } | 45 } |
| 46 if (is_one_byte_string) { | 46 if (is_one_byte_string) { |
| 47 return OneByteString::New(utf32_array, array_len, Heap::kNew); | 47 return OneByteString::New(utf32_array, array_len, Heap::kNew); |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 if (!elem.IsString()) { | 147 if (!elem.IsString()) { |
| 148 GrowableArray<const Object*> args; | 148 GrowableArray<const Object*> args; |
| 149 args.Add(&elem); | 149 args.Add(&elem); |
| 150 Exceptions::ThrowByType(Exceptions::kArgument, args); | 150 Exceptions::ThrowByType(Exceptions::kArgument, args); |
| 151 } | 151 } |
| 152 } | 152 } |
| 153 return String::ConcatAll(strings); | 153 return String::ConcatAll(strings); |
| 154 } | 154 } |
| 155 | 155 |
| 156 } // namespace dart | 156 } // namespace dart |
| OLD | NEW |