Bug 1423878: Remove check for detached ArrayBuffer before CloneArrayBuffer per ES2018. r=jandem
authorAndré Bargull <andre.bargull@gmail.com>
Thu, 07 Dec 2017 05:25:20 -0800
changeset 401118 2175c053b6ebdf6b1bb0efa7dd2ee6590869b972
parent 401117 8b6bb4335d4bb4e47045921aebe730113e9bd693
child 401119 1e5c359b9fe38d29b65fb6c872505c124895a9f2
push id99295
push userrgurzau@mozilla.com
push dateSat, 27 Jan 2018 22:30:16 +0000
treeherdermozilla-inbound@2175c053b6eb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem
bugs1423878
milestone60.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1423878: Remove check for detached ArrayBuffer before CloneArrayBuffer per ES2018. r=jandem
js/src/vm/TypedArrayObject.cpp
--- a/js/src/vm/TypedArrayObject.cpp
+++ b/js/src/vm/TypedArrayObject.cpp
@@ -1201,26 +1201,20 @@ TypedArrayObjectTemplate<T>::fromTypedAr
 
     RootedObject bufferCtor(cx, GetBufferSpeciesConstructor(cx, srcArray, isWrapped, override));
     if (!bufferCtor)
         return nullptr;
 
     // 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;
     } else {
         // Steps 14-15, 19.a.
         if (!AllocateArrayBuffer(cx, bufferCtor, elementLength, BYTES_PER_ELEMENT, &buffer))
             return nullptr;
     }