[whatwg/webidl] Throw, instead of assert, for transferring detached ArrayBuffers (PR #1420)

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](https://dontcallmedom.github.io/webdex/t.html#transfer%40%40ArrayBuffer%40dfn) and they are all fine with this. (Most are just referencing the concept of transferring, as these definitions are not yet widely used.)


<!--
    This comment and the below content is programmatically generated.
    You may add a comma-separated list of anchors you'd like a
    direct link to below (e.g. #idl-serializers, #idl-sequence):

    Don't remove this comment or modify anything below this line.
    If you don't want a preview generated for this pull request,
    just replace the whole of this comment's content by "no preview"
    and remove what's below.
-->
***
<a href="https://whatpr.org/webidl/1420.html" title="Last updated on Jul 18, 2024, 1:23 AM UTC (bf45161)">Preview</a> | <a href="https://whatpr.org/webidl/1420/3fb6ab4...bf45161.html" title="Last updated on Jul 18, 2024, 1:23 AM UTC (bf45161)">Diff</a>
You can view, comment on, or merge this pull request online at:

  https://github.com/whatwg/webidl/pull/1420

-- Commit Summary --

  * Throw, instead of assert, for transferring detached ArrayBuffers

-- File Changes --

    M index.bs (6)

-- Patch Links --

https://github.com/whatwg/webidl/pull/1420.patch
https://github.com/whatwg/webidl/pull/1420.diff

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

Message ID: <whatwg/webidl/pull/1420@github.com>

Received on Thursday, 18 July 2024 01:23:50 UTC