whatwg / webidl

Web IDL Standard
https://webidl.spec.whatwg.org/
Other
410 stars 164 forks source link

Throw, instead of assert, for transferring detached ArrayBuffers #1420

Closed domenic closed 4 months ago

domenic commented 4 months ago

This makes the algorithm more user-friendly, as this is generally the desired behavior, and the algorithm can already throw for other reasons so callers are expected to handle that.

/cc @inexorabletash as this was inspired by your work in https://github.com/whatwg/webidl/pull/1419.

I audited the callers and they are all fine with this. (Most are just referencing the concept of transferring, as these definitions are not yet widely used.)


Preview | Diff

domenic commented 4 months ago

I think you're right that this algorithm assumes same agent-cluster. Let me fix that in a separate PR.