You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not sure the best way to handle this. I see a few options:
Return a new empty array buffer (or corresponding view) when the incoming array buffer is detached. This is a bit tricky since then 99% of the time a non-throwing conversion returns the input, but sometimes it doesn't.
Revert to having no special detached handling. This is similar to returning a new empty buffer in practice, since V8 treats detached buffers as zero-length buffers in most parts of the API.
Implement the full " getting a reference to" / "getting a copy of" algorithms. This is not so great because specs generally don't use these algorithms yet and there's planned work to change them in https://www.w3.org/Bugs/Public/show_bug.cgi?id=28798.
Try to implement https://www.w3.org/Bugs/Public/show_bug.cgi?id=28798. This seems kind of reasonable. However, any implementation that actually performs a copy would add a performance hit to jsdom. And I'm not sure that's really necessary given that we're single-threaded anyway?
I'm leaning toward (2), and potentially reassessing if we run into an API where this actually matters.
647d873 added throwing on detached buffers, but this is not correct. See whatwg/webidl#352 and whatwg/webidl#151 .
Sigh. I guess I just implemented that from memory.
The text was updated successfully, but these errors were encountered: