script: Throw error when lower is greater than upper in IDBKeyRange (#38735)

IDBKeyRange::Bound doesn't check if the lower bound is greater than the
upper bound. When this happens, it should throw DataError.

Reference: Step 5 of
<https://www.w3.org/TR/IndexedDB-2/#dom-idbkeyrange-bound>

Testing: Passing WPT tests that were expected to fail before.

---------

Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
This commit is contained in:
Kingsley Yung 2025-08-17 23:21:45 +08:00 committed by GitHub
parent ee781b71b4
commit d490c5c06b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 17 additions and 7 deletions

View file

@ -1,15 +1,9 @@
[idbkeyrange_incorrect.any.html]
[IDBKeyRange.bound(lower, upper / lower > upper) - lower' is greater than 'upper'.]
expected: FAIL
[IDBKeyRange.bound(DOMString/Date/Array, 1) - A DOMString, Date and Array are greater than a float.]
expected: FAIL
[idbkeyrange_incorrect.any.worker.html]
[IDBKeyRange.bound(lower, upper / lower > upper) - lower' is greater than 'upper'.]
expected: FAIL
[IDBKeyRange.bound(DOMString/Date/Array, 1) - A DOMString, Date and Array are greater than a float.]
expected: FAIL