Invalid return type for key conversion (#39252)

`convert_value_to_key` returns a `ConversionResult` now, so keys can be
considered "Invalid" rather than throwing an exception.

Testing: WPT
Unblocks: #38288

---------

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
This commit is contained in:
Ashwin Naren 2025-09-11 05:48:18 -07:00 committed by GitHub
parent 19f70dccf6
commit 96592dce44
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 41 additions and 23 deletions

View file

@ -98,8 +98,8 @@ impl IDBFactoryMethods<crate::DomTypeHolder> for IDBFactory {
// https://www.w3.org/TR/IndexedDB-2/#dom-idbfactory-cmp
fn Cmp(&self, cx: SafeJSContext, first: HandleValue, second: HandleValue) -> Fallible<i16> {
let first_key = convert_value_to_key(cx, first, None)?;
let second_key = convert_value_to_key(cx, second, None)?;
let first_key = convert_value_to_key(cx, first, None)?.into_result()?;
let second_key = convert_value_to_key(cx, second, None)?.into_result()?;
let cmp = first_key.partial_cmp(&second_key);
if let Some(cmp) = cmp {
match cmp {