script: Check if IndexedDB key path is ECMAScript identifier name (#39255)

From IndexedDB spec, when we check whether a key path is valid, we have
to check whether it is an ECMAScript identifier name. We have not yet
implemented this logic, and always return true.

This patch uses the function `js::rust::wrappers::JS_IsIdentifier` to
achieve this checking.

Testing: Pass WPT tests that were expected to fail.
Fixes: #25324

---------

Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
This commit is contained in:
Kingsley Yung 2025-09-12 23:02:28 +08:00 committed by GitHub
parent 25147c75cb
commit a4c6108cbe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 48 additions and 37 deletions

View file

@ -2,9 +2,6 @@
[IDBDatabase.createObjectStore exception order: InvalidStateError vs. TransactionInactiveError]
expected: FAIL
[IDBDatabase.createObjectStore exception order: SyntaxError vs. ConstraintError]
expected: FAIL
[idbdatabase-createObjectStore-exception-order.any.sharedworker.html]
expected: ERROR
@ -15,6 +12,3 @@
[idbdatabase-createObjectStore-exception-order.any.html]
[IDBDatabase.createObjectStore exception order: InvalidStateError vs. TransactionInactiveError]
expected: FAIL
[IDBDatabase.createObjectStore exception order: SyntaxError vs. ConstraintError]
expected: FAIL

View file

@ -8,12 +8,6 @@
[Attempt to create an object store outside of a version change transaction ]
expected: FAIL
[Attempt to create an object store with an invalid key path ]
expected: FAIL
[autoInc and keyPath object]
expected: FAIL
[idbdatabase_createObjectStore.any.worker.html]
[Both with empty name]
@ -22,12 +16,6 @@
[Attempt to create an object store outside of a version change transaction ]
expected: FAIL
[Attempt to create an object store with an invalid key path ]
expected: FAIL
[autoInc and keyPath object]
expected: FAIL
[idbdatabase_createObjectStore.any.serviceworker.html]
expected: ERROR

View file

@ -16,12 +16,6 @@
[Deactivation of new transactions happens at end of invocation]
expected: FAIL
[New transactions are deactivated before next task]
expected: FAIL
[New transactions from microtask are deactivated before next task]
expected: FAIL
[transaction-deactivation-timing.any.sharedworker.html]
expected: ERROR