mirror of
https://github.com/servo/servo.git
synced 2025-09-30 08:39:16 +01:00
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:
parent
19f70dccf6
commit
96592dce44
4 changed files with 41 additions and 23 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue