KEMBAR78
"Convert a value to a key" should return invalid for detached array buffers by SteveBeckerMSFT · Pull Request #440 · w3c/IndexedDB · GitHub
Skip to content

Conversation

@SteveBeckerMSFT
Copy link
Collaborator

@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
<!-- 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
Collaborator 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
Collaborator 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

Development

Successfully merging this pull request may close these issues.

Inconsistency between spec and tests for detached arraybuffers; spec for keys says don't throw, test for keys says throw, spec for values says throw

2 participants