mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 786903 - restore typedArray(otherTypedArray) initialization fastpath; r=sfink
This commit is contained in:
parent
ecc761ed3a
commit
32b99ebba8
@ -1726,8 +1726,11 @@ class TypedArrayTemplate
|
||||
fromArray(JSContext *cx, HandleObject other)
|
||||
{
|
||||
uint32_t len;
|
||||
if (!GetLengthProperty(cx, other, &len))
|
||||
if (other->isTypedArray()) {
|
||||
len = length(other);
|
||||
} else if (!GetLengthProperty(cx, other, &len)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
RootedObject bufobj(cx, createBufferWithSizeAndCount(cx, len));
|
||||
if (!bufobj)
|
||||
@ -1821,6 +1824,9 @@ class TypedArrayTemplate
|
||||
JS_ASSERT(thisTypedArrayObj->isTypedArray());
|
||||
JS_ASSERT(offset <= length(thisTypedArrayObj));
|
||||
JS_ASSERT(len <= length(thisTypedArrayObj) - offset);
|
||||
if (ar->isTypedArray())
|
||||
return copyFromTypedArray(cx, thisTypedArrayObj, ar, offset);
|
||||
|
||||
NativeType *dest = static_cast<NativeType*>(viewData(thisTypedArrayObj)) + offset;
|
||||
SkipRoot skip(cx, &dest);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user