Implement indexeddb array conversion (#38288)

Implement conversion from js arrays into rust.

Testing: WPT
Fixes: None

---------

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
Ashwin Naren 2025-09-19 23:33:16 -07:00 committed by GitHub
parent 8590c4edcf
commit 8a59c2cf56
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 98 additions and 203 deletions

View file

@ -1,4 +1,5 @@
[idb-partitioned-coverage.sub.html]
expected: CRASH
[ - advance]
expected: FAIL

View file

@ -1,7 +1,4 @@
[idbcursor-continuePrimaryKey-exceptions.any.worker.html]
[IDBCursor continuePrimaryKey() on object store cursor]
expected: FAIL
[IDBCursor continuePrimaryKey() on "nextunique" cursor]
expected: FAIL

View file

@ -2,9 +2,6 @@
expected: ERROR
[idbfactory_cmp.any.html]
[Array vs. Binary]
expected: FAIL
[Compare in unsigned octet values (in the range [0, 255\])]
expected: FAIL
@ -13,9 +10,6 @@
[idbfactory_cmp.any.worker.html]
[Array vs. Binary]
expected: FAIL
[Compare in unsigned octet values (in the range [0, 255\])]
expected: FAIL

View file

@ -1,4 +1,5 @@
[idbkeyrange-includes.any.html]
expected: CRASH
[IDBKeyRange.includes() with invalid input]
expected: FAIL
@ -13,6 +14,7 @@
expected: ERROR
[idbkeyrange-includes.any.worker.html]
expected: CRASH
[IDBKeyRange.includes() with invalid input]
expected: FAIL

View file

@ -1,12 +1,6 @@
[idbkeyrange_incorrect.any.html]
[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(DOMString/Date/Array, 1) - A DOMString, Date and Array are greater than a float.]
expected: FAIL
[idbkeyrange_incorrect.any.serviceworker.html]
expected: ERROR

View file

@ -17,6 +17,9 @@
[Get all values with invalid query keys]
expected: FAIL
[Get all values with transaction.commit()]
expected: FAIL
[idbobjectstore_getAll.any.serviceworker.html]
expected: ERROR
@ -40,6 +43,9 @@
[Get all values with invalid query keys]
expected: FAIL
[Get all values with transaction.commit()]
expected: FAIL
[idbobjectstore_getAll.any.sharedworker.html]
expected: ERROR

View file

@ -2,6 +2,7 @@
expected: ERROR
[idbobjectstore_openKeyCursor.any.html]
expected: CRASH
[IDBObjectStore.openKeyCursor() - forward iteration]
expected: FAIL
@ -22,6 +23,7 @@
expected: ERROR
[idbobjectstore_openKeyCursor.any.worker.html]
expected: CRASH
[IDBObjectStore.openKeyCursor() - forward iteration]
expected: FAIL

View file

@ -2,54 +2,12 @@
expected: ERROR
[key-conversion-exceptions.any.worker.html]
[IDBFactory cmp() static with throwing/invalid keys]
expected: FAIL
[IDBKeyRange only() static with throwing/invalid keys]
expected: FAIL
[IDBKeyRange lowerBound() static with throwing/invalid keys]
expected: FAIL
[IDBKeyRange upperBound() static with throwing/invalid keys]
expected: FAIL
[IDBKeyRange bound() static with throwing/invalid keys]
expected: FAIL
[IDBCursor continue() method with throwing/invalid keys]
expected: FAIL
[IndexedDB: Exceptions thrown during key conversion]
expected: FAIL
[IDBCursor update() method with throwing/invalid keys]
expected: FAIL
[IDBObjectStore add() method with throwing/invalid keys]
expected: FAIL
[IDBObjectStore put() method with throwing/invalid keys]
expected: FAIL
[IDBObjectStore delete() method with throwing/invalid keys]
expected: FAIL
[IDBObjectStore get() method with throwing/invalid keys]
expected: FAIL
[IDBObjectStore getKey() method with throwing/invalid keys]
expected: FAIL
[IDBObjectStore count() method with throwing/invalid keys]
expected: FAIL
[IDBObjectStore openCursor() method with throwing/invalid keys]
expected: FAIL
[IDBObjectStore openKeyCursor() method with throwing/invalid keys]
expected: FAIL
[IDBIndex get() method with throwing/invalid keys]
expected: FAIL
@ -65,12 +23,6 @@
[IDBIndex openKeyCursor() method with throwing/invalid keys]
expected: FAIL
[IDBObjectStore getAll() method with throwing/invalid keys]
expected: FAIL
[IDBObjectStore getAllKeys() method with throwing/invalid keys]
expected: FAIL
[IDBIndex getAll() method with throwing/invalid keys]
expected: FAIL
@ -82,54 +34,12 @@
[key-conversion-exceptions.any.html]
[IDBFactory cmp() static with throwing/invalid keys]
expected: FAIL
[IDBKeyRange only() static with throwing/invalid keys]
expected: FAIL
[IDBKeyRange lowerBound() static with throwing/invalid keys]
expected: FAIL
[IDBKeyRange upperBound() static with throwing/invalid keys]
expected: FAIL
[IDBKeyRange bound() static with throwing/invalid keys]
expected: FAIL
[IDBCursor continue() method with throwing/invalid keys]
expected: FAIL
[IndexedDB: Exceptions thrown during key conversion]
expected: FAIL
[IDBCursor update() method with throwing/invalid keys]
expected: FAIL
[IDBObjectStore add() method with throwing/invalid keys]
expected: FAIL
[IDBObjectStore put() method with throwing/invalid keys]
expected: FAIL
[IDBObjectStore delete() method with throwing/invalid keys]
expected: FAIL
[IDBObjectStore get() method with throwing/invalid keys]
expected: FAIL
[IDBObjectStore getKey() method with throwing/invalid keys]
expected: FAIL
[IDBObjectStore count() method with throwing/invalid keys]
expected: FAIL
[IDBObjectStore openCursor() method with throwing/invalid keys]
expected: FAIL
[IDBObjectStore openKeyCursor() method with throwing/invalid keys]
expected: FAIL
[IDBIndex get() method with throwing/invalid keys]
expected: FAIL
@ -145,12 +55,6 @@
[IDBIndex openKeyCursor() method with throwing/invalid keys]
expected: FAIL
[IDBObjectStore getAll() method with throwing/invalid keys]
expected: FAIL
[IDBObjectStore getAllKeys() method with throwing/invalid keys]
expected: FAIL
[IDBIndex getAll() method with throwing/invalid keys]
expected: FAIL

View file

@ -2,6 +2,7 @@
expected: ERROR
[key_invalid.any.worker.html]
expected: CRASH
[Invalid key - [{}\]]
expected: FAIL
@ -40,6 +41,7 @@
expected: ERROR
[key_invalid.any.html]
expected: CRASH
[Invalid key - [{}\]]
expected: FAIL

View file

@ -5,149 +5,77 @@
[Database readback sort - String < Array]
expected: FAIL
[IDBKey.cmp sort - String < Array]
expected: FAIL
[Database readback sort - float < String]
expected: FAIL
[IDBKey.cmp sort - float < String]
expected: FAIL
[Database readback sort - float < Date]
expected: FAIL
[IDBKey.cmp sort - float < Date]
expected: FAIL
[Database readback sort - float < Date < String < Array]
expected: FAIL
[IDBKey.cmp sort - float < Date < String < Array]
expected: FAIL
[Database readback sort - Date(1 sec ago) < Date(now) < Date(1 minute in future)]
expected: FAIL
[IDBKey.cmp sort - Date(1 sec ago) < Date(now) < Date(1 minute in future)]
expected: FAIL
[Database readback sort - -1.1 < 1 < 1.01337 < 1.013373 < 2]
expected: FAIL
[IDBKey.cmp sort - -1.1 < 1 < 1.01337 < 1.013373 < 2]
expected: FAIL
[Database readback sort - -Infinity < -0.01 < 0 < Infinity]
expected: FAIL
[IDBKey.cmp sort - -Infinity < -0.01 < 0 < Infinity]
expected: FAIL
[Database readback sort - "" < "a" < "ab" < "b" < "ba"]
expected: FAIL
[IDBKey.cmp sort - "" < "a" < "ab" < "b" < "ba"]
expected: FAIL
[Database readback sort - Arrays]
expected: FAIL
[IDBKey.cmp sort - Arrays]
expected: FAIL
[Database readback sort - Array.length: 10,000 < Array.length: 10,001]
expected: FAIL
[IDBKey.cmp sort - Array.length: 10,000 < Array.length: 10,001]
expected: FAIL
[Database readback sort - Infinity inside arrays]
expected: FAIL
[IDBKey.cmp sort - Infinity inside arrays]
expected: FAIL
[Database readback sort - Test different stuff at once]
expected: FAIL
[IDBKey.cmp sort - Test different stuff at once]
expected: FAIL
[keyorder.any.html]
[Database readback sort - String < Array]
expected: FAIL
[IDBKey.cmp sort - String < Array]
expected: FAIL
[Database readback sort - float < String]
expected: FAIL
[IDBKey.cmp sort - float < String]
expected: FAIL
[Database readback sort - float < Date]
expected: FAIL
[IDBKey.cmp sort - float < Date]
expected: FAIL
[Database readback sort - float < Date < String < Array]
expected: FAIL
[IDBKey.cmp sort - float < Date < String < Array]
expected: FAIL
[Database readback sort - Date(1 sec ago) < Date(now) < Date(1 minute in future)]
expected: FAIL
[IDBKey.cmp sort - Date(1 sec ago) < Date(now) < Date(1 minute in future)]
expected: FAIL
[Database readback sort - -1.1 < 1 < 1.01337 < 1.013373 < 2]
expected: FAIL
[IDBKey.cmp sort - -1.1 < 1 < 1.01337 < 1.013373 < 2]
expected: FAIL
[Database readback sort - -Infinity < -0.01 < 0 < Infinity]
expected: FAIL
[IDBKey.cmp sort - -Infinity < -0.01 < 0 < Infinity]
expected: FAIL
[Database readback sort - "" < "a" < "ab" < "b" < "ba"]
expected: FAIL
[IDBKey.cmp sort - "" < "a" < "ab" < "b" < "ba"]
expected: FAIL
[Database readback sort - Arrays]
expected: FAIL
[IDBKey.cmp sort - Arrays]
expected: FAIL
[Database readback sort - Array.length: 10,000 < Array.length: 10,001]
expected: FAIL
[IDBKey.cmp sort - Array.length: 10,000 < Array.length: 10,001]
expected: FAIL
[Database readback sort - Infinity inside arrays]
expected: FAIL
[IDBKey.cmp sort - Infinity inside arrays]
expected: FAIL
[Database readback sort - Test different stuff at once]
expected: FAIL
[IDBKey.cmp sort - Test different stuff at once]
expected: FAIL
[keyorder.any.serviceworker.html]
expected: ERROR

View file

@ -1,8 +1,13 @@
[keypath-exceptions.any.html]
expected: CRASH
[Array key conversion should not invoke prototype getters]
expected: FAIL
[The last element of keypath is validated]
expected: FAIL
[Key path evaluation: Exceptions from non-enumerable getters]
expected: FAIL
[keypath-exceptions.any.serviceworker.html]
expected: ERROR
@ -11,6 +16,11 @@
expected: ERROR
[keypath-exceptions.any.worker.html]
expected: CRASH
[Array key conversion should not invoke prototype getters]
expected: FAIL
[The last element of keypath is validated]
expected: FAIL
[Key path evaluation: Exceptions from non-enumerable getters]
expected: FAIL