Chromium Code Reviews| Index: runtime/vm/dart_api_impl.cc |
| =================================================================== |
| --- runtime/vm/dart_api_impl.cc (revision 15751) |
| +++ runtime/vm/dart_api_impl.cc (working copy) |
| @@ -2010,6 +2010,7 @@ |
| DARTSCOPE(isolate); |
| const Object& obj = Object::Handle(isolate, Api::UnwrapHandle(list)); |
| if (obj.IsUint8Array() || obj.IsExternalUint8Array() || |
| + obj.IsUint8ClampedArray() || obj.IsExternalUint8ClampedArray() || |
| obj.IsInt8Array() || obj.IsExternalInt8Array()) { |
| const ByteArray& byte_array = ByteArray::Cast(obj); |
| if (Utils::RangeCheck(offset, length, byte_array.Length())) { |
| @@ -2095,7 +2096,8 @@ |
| Isolate* isolate = Isolate::Current(); |
| DARTSCOPE(isolate); |
| const Object& obj = Object::Handle(isolate, Api::UnwrapHandle(list)); |
| - if (obj.IsUint8Array() || obj.IsExternalUint8Array()) { |
| + if (obj.IsUint8Array() || obj.IsExternalUint8Array() || |
| + obj.IsUint8ClampedArray() || obj.IsExternalUint8ClampedArray()) { |
|
cshapiro
2012/12/05 23:01:49
Maybe add the Int8Array cases for symmetry like on
srdjan
2012/12/06 19:23:14
The incoming type is uint8_t not int8_t?
|
| const ByteArray& byte_array = ByteArray::Cast(obj); |
| if (Utils::RangeCheck(offset, length, byte_array.Length())) { |
| ByteArray::Copy(byte_array, offset, native_array, length); |