script: Re-implement evaluate_key_path_on_value in IndexedDB (#38847)

The current implementation of evaluate_key_path_on_value was translated
from gecko, and it is incomplete. The unimplemented part occurs many
crashes in WPT tests.

This PR re-implements it according to the spec. It should eliminate many
crashed WPT tests, and increase the code readability.

Testing: Update WPT test expectation
Fixes: #38817 partially, and #25325

---------

Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
This commit is contained in:
Kingsley Yung 2025-09-05 16:00:07 +08:00 committed by GitHub
parent ebc1282c7a
commit b29eab0ffe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 694 additions and 178 deletions

View file

@ -1,11 +1,129 @@
[keypath.any.worker.html]
expected: CRASH
[undefined - my.key]
expected: FAIL
[undefined - my.køi]
expected: FAIL
[undefined - my.key_ya]
expected: FAIL
[undefined - public.key$ya]
expected: FAIL
[undefined - true.$]
expected: FAIL
[undefined - my._]
expected: FAIL
[undefined - delete.a7]
expected: FAIL
[undefined - p.p.p.p.p.p.p.p.p.p.p.p.p.p]
expected: FAIL
[undefined - str.length]
expected: FAIL
[undefined - arr.length]
expected: FAIL
[undefined - length]
expected: FAIL
[undefined - '' uses value as key]
expected: FAIL
[undefined - [''\] uses value as [key\]]
expected: FAIL
[undefined - ['x', 'y'\]]
expected: FAIL
[undefined - [['x'\], 'y'\] (stringifies)]
expected: FAIL
[undefined - ['x', {toString->'y'}\] (stringifies)]
expected: FAIL
[undefined - name,type]
expected: FAIL
[undefined - name,type.name]
expected: FAIL
[undefined - list with 1 field]
expected: FAIL
[undefined - array loop -> stringify becomes [''\]]
expected: FAIL
[keypath.any.serviceworker.html]
expected: ERROR
[keypath.any.html]
expected: CRASH
[undefined - my.key]
expected: FAIL
[undefined - my.køi]
expected: FAIL
[undefined - my.key_ya]
expected: FAIL
[undefined - public.key$ya]
expected: FAIL
[undefined - true.$]
expected: FAIL
[undefined - my._]
expected: FAIL
[undefined - delete.a7]
expected: FAIL
[undefined - p.p.p.p.p.p.p.p.p.p.p.p.p.p]
expected: FAIL
[undefined - str.length]
expected: FAIL
[undefined - arr.length]
expected: FAIL
[undefined - length]
expected: FAIL
[undefined - '' uses value as key]
expected: FAIL
[undefined - [''\] uses value as [key\]]
expected: FAIL
[undefined - ['x', 'y'\]]
expected: FAIL
[undefined - [['x'\], 'y'\] (stringifies)]
expected: FAIL
[undefined - ['x', {toString->'y'}\] (stringifies)]
expected: FAIL
[undefined - name,type]
expected: FAIL
[undefined - name,type.name]
expected: FAIL
[undefined - list with 1 field]
expected: FAIL
[undefined - array loop -> stringify becomes [''\]]
expected: FAIL
[keypath.any.sharedworker.html]
expected: ERROR