mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 00:01:50 +00:00
Bug 1686936 part 9 - Make GetElements work with large buffers. r=anba
Depends on D102150 Differential Revision: https://phabricator.services.mozilla.com/D102151
This commit is contained in:
parent
c151cdec28
commit
2ab627369b
@ -453,7 +453,7 @@ bool js::GetElements(JSContext* cx, HandleObject aobj, uint32_t length,
|
||||
|
||||
if (aobj->is<TypedArrayObject>()) {
|
||||
Handle<TypedArrayObject*> typedArray = aobj.as<TypedArrayObject>();
|
||||
if (typedArray->length().deprecatedGetUint32() == length) {
|
||||
if (typedArray->length().get() == length) {
|
||||
return TypedArrayObject::getElements(cx, typedArray, vp);
|
||||
}
|
||||
}
|
||||
|
@ -2190,13 +2190,13 @@ bool TypedArrayObject::getElementPure(size_t index, Value* vp) {
|
||||
bool TypedArrayObject::getElements(JSContext* cx,
|
||||
Handle<TypedArrayObject*> tarray,
|
||||
Value* vp) {
|
||||
uint32_t length = tarray->length().deprecatedGetUint32();
|
||||
size_t length = tarray->length().get();
|
||||
MOZ_ASSERT_IF(length > 0, !tarray->hasDetachedBuffer());
|
||||
|
||||
switch (tarray->type()) {
|
||||
#define GET_ELEMENTS(T, N) \
|
||||
case Scalar::N: \
|
||||
for (uint32_t i = 0; i < length; ++i, ++vp) { \
|
||||
for (size_t i = 0; i < length; ++i, ++vp) { \
|
||||
if (!N##Array::getElement(cx, tarray, i, \
|
||||
MutableHandleValue::fromMarkedLocation(vp))) { \
|
||||
return false; \
|
||||
|
Loading…
Reference in New Issue
Block a user