mirror of
https://github.com/servo/servo.git
synced 2025-09-30 00:29:14 +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
|
@ -211,7 +211,7 @@ impl IDBObjectStore {
|
|||
let serialized_key: Option<IndexedDBKeyType>;
|
||||
|
||||
if !key.is_undefined() {
|
||||
serialized_key = Some(convert_value_to_key(cx, key, None)?);
|
||||
serialized_key = Some(convert_value_to_key(cx, key, None)?.into_result()?);
|
||||
} else {
|
||||
// Step 11: We should use in-line keys instead
|
||||
if let Some(Ok(ExtractionResult::Key(kpk))) = self
|
||||
|
@ -287,7 +287,7 @@ impl IDBObjectStoreMethods<crate::DomTypeHolder> for IDBObjectStore {
|
|||
|
||||
// Step 6
|
||||
// TODO: Convert to key range instead
|
||||
let serialized_query = convert_value_to_key(cx, query, None);
|
||||
let serialized_query = convert_value_to_key(cx, query, None)?.into_result();
|
||||
// Step 7. Let operation be an algorithm to run delete records from an object store with store and range.
|
||||
// Stpe 8. Return the result (an IDBRequest) of running asynchronously execute a request with this and operation.
|
||||
let (sender, receiver) = indexed_db::create_channel(self.global());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue