mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-15 14:25:52 +00:00
Bug 1423878: Remove check for detached ArrayBuffer before CloneArrayBuffer per ES2018. r=jandem
This commit is contained in:
parent
d59edfc08b
commit
ca93312f36
@ -1206,16 +1206,10 @@ TypedArrayObjectTemplate<T>::fromTypedArray(JSContext* cx, HandleObject other, b
|
||||
// Steps 8, 18-19.
|
||||
Rooted<ArrayBufferObject*> buffer(cx);
|
||||
if (ArrayTypeID() == srcType) {
|
||||
// Step 18.a.
|
||||
if (srcArray->hasDetachedBuffer()) {
|
||||
JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_TYPED_ARRAY_DETACHED);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// Step 15.
|
||||
uint32_t byteLength = srcArray->byteLength();
|
||||
|
||||
// Step 18.b.
|
||||
// Step 18.a.
|
||||
// 24.1.1.4 CloneArrayBuffer(...), steps 1-3.
|
||||
if (!AllocateArrayBuffer(cx, bufferCtor, byteLength, 1, &buffer))
|
||||
return nullptr;
|
||||
|
Loading…
Reference in New Issue
Block a user