- From: Steven Becker <notifications@github.com>
- Date: Thu, 26 Jun 2025 14:29:41 -0700
- To: w3c/IndexedDB <IndexedDB@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <w3c/IndexedDB/pull/461/review/2963725118@github.com>
@SteveBeckerMSFT commented on this pull request. > @@ -1371,6 +1371,38 @@ To <dfn>convert a value to a key range</dfn> with </div> + +A <dfn>potentially valid key range</dfn> is a value that is a [=key/type|type of key=] or a [=key range=]. +However, [=convert a value to a key range|converting=] a [=potentially valid key range=] to a [=key range=] could throw an exception. + +NOTE: + For example, a value that is a [=BufferSource/detached|detached BufferSource=] is a [=potentially valid key range=] that will throw an exception when used with [=convert a value to a key range=]. + +<div algorithm> + + To determine when a value <dfn>is a potentially valid key range</dfn> with |value|, run these steps: Yes, it produces different results. I'll add a note to explain this better. For compat, I think we want to preserve exceptions for inputs that are types of keys, but not valid keys. Dates, Arrays and ArrayBuffers are all objects that can be parsed as the IDBGetAllOptions dictionary successfully, which I think we should Examples of inputs that should throw instead of being parsed successfully as an IDBGetAllOptions: 1. [ 1, "five", { invalid: "key" }, ] 2. A detached array buffer. I will also add a WPT to exercise these cases. I admit this is the messiest part of the spec. One alternative that we've discussed before is to add a required member to the dictionary like 'direction', which would also cause the inputs above to throw. However, perhaps there is a better way to spec this that I'm missing. Thoughts? -- Reply to this email directly or view it on GitHub: https://github.com/w3c/IndexedDB/pull/461#discussion_r2170053187 You are receiving this because you are subscribed to this thread. Message ID: <w3c/IndexedDB/pull/461/review/2963725118@github.com>
Received on Thursday, 26 June 2025 21:29:45 UTC