Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Convert a value to a key" should return invalid for detached array buffers #440

Merged

Conversation

SteveBeckerMSFT
Copy link
Contributor

@SteveBeckerMSFT SteveBeckerMSFT commented Feb 26, 2025

Closes #417 by updating "7.4 Convert a value to a key" to return invalid when the input buffer source is detached.

The following tasks have been completed:

Implementation commitment:


Preview | Diff

Copy link
Member

@inexorabletash inexorabletash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two more things:

  • Add yourself to the Acknowledgements section
  • Add an entry to the Revision History section

index.bs Outdated
@@ -6366,9 +6366,11 @@ steps may throw an exception.
<!-- Binary -->
: If |input| is a [=buffer source type=]
::
1. If [$IsDetachedBuffer$](|input|) is true then return invalid.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IsDetachedBuffer() takes an ArrayBuffer or a SharedArrayBuffer, but buffer source type includes the views. I think you'll need to dig the buffer out of the view in those cases?

Copy link
Contributor Author

@SteveBeckerMSFT SteveBeckerMSFT Feb 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review! I got the new steps from the WebIDL spec here:

https://webidl.spec.whatwg.org/#buffersource-detached

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated the latest revision to use the shorthand for these steps.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome. This all seemed very familiar... whatwg/webidl#1420 ... apparently we needed something similar over in WebNN. :)

@inexorabletash inexorabletash merged commit c659eb3 into main Feb 26, 2025
2 checks passed
@inexorabletash
Copy link
Member

Thanks @SteveBeckerMSFT !

github-actions bot added a commit that referenced this pull request Feb 26, 2025
…uffers (#440)

SHA: c659eb3
Reason: push, by inexorabletash

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants