Chromium's implementations of Web Bluetooth and WebUSB currently throw a
non-standard InvalidStateError when passed an ArrayBuffer or TypedArray
which has been detached (e.g. by calling transfer() or using postMessage()
to send the buffer through a MessagePort).

I will be changing these APIs to follow the "get a copy of the bytes held
by the buffer source
<https://webidl.spec.whatwg.org/#dfn-get-buffer-source-copy>" algorithm and
treat a detached buffer as an empty byte sequence.

I expect this will not have any web compatibility impact because it is a
programming error to pass a detached buffer to these APIs, which is why we
added the exception to begin with. This change makes the APIs consistent
with other buffer-consuming APIs like Web Serial and WebHID, where we
handle this case with the specified behavior.

Reilly Grant | Software Engineer | reil...@google.com | Google Chrome
<https://www.google.com/chrome>

-- 
You received this message because you are subscribed to the Google Groups 
"blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to blink-dev+unsubscr...@chromium.org.
To view this discussion on the web visit 
https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAEmk%3DMa1caEjoXXe3R7q5Fyb3UCGrLVAnHUuTaOifLw_epUf8g%40mail.gmail.com.

Reply via email to