Re: [heycam/webidl] Detached ArrayBuffer objects should not throw (#605)

domenic commented on this pull request.



> @@ -8171,8 +8171,8 @@ a reference to the same object that the IDL value represents.
         1.  Set |offset| to the value of |O|’s \[[ByteOffset]] [=internal slot=].
         1.  Set |length| to the value of |O|’s \[[ByteLength]] [=internal slot=].
     1.  Otherwise, set |length| to the value of |O|’s \[[ArrayBufferByteLength]] [=internal slot=].
-    1.  If <a abstract-op>IsDetachedBuffer</a>(|O|), then
-        [=ECMAScript/throw=] a {{ECMAScript/TypeError}}.
+    1.  If <a abstract-op>IsDetachedBuffer</a>(|arrayBuffer|) is <emu-val>true</emu-val>, then
+        return a reference to or a copy of (as required) the empty byte sequence.

How do you have a reference or copy of something empty, though? (Presumably newly-created? Or is everyone sharing a reference to a single empty byte sequence?) You only reference or copy existing things. This failure path is special and shouldn't be doing reference or copy.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/heycam/webidl/pull/605#discussion_r246501038

Received on Wednesday, 9 January 2019 20:00:48 UTC