indexeddb: align getAll/getAllKeys and convert_value_to_key with IndexedDB spec#43041
Conversation
|
🔨 Triggering try run (#22728440220) for Linux (WPT) |
|
Test results for linux-wpt from try job (#22728440220): Flaky unexpected result (28)
Stable unexpected results that are known to be intermittent (17)
|
|
✨ Try run (#22728440220) succeeded. |
|
🔨 Triggering try run (#23051614714) for Linux (WPT) |
|
Test results for linux-wpt from try job (#23051614714): Flaky unexpected result (29)
Stable unexpected results that are known to be intermittent (14)
|
|
✨ Try run (#23051614714) succeeded. |
janvarga
left a comment
There was a problem hiding this comment.
Looks good to me, nice to have all those "step" comments in the code.
| })? | ||
| .collect::<Result<Vec<_>, _>>()?; | ||
|
|
||
| let mut models_with_keys = models |
There was a problem hiding this comment.
Do I understand this correctly, that all db rows are loaded into memory and only then filtered?
I believe the filtering could/should be done at db level in future, can you add a TODO for that?
| for seen_input in &seen { | ||
| let mut same = false; | ||
| if unsafe { !SameValue(cx.raw_cx(), *seen_input, input, &mut same) } { | ||
| return Err(Error::JSFailed); |
There was a problem hiding this comment.
Should you not just return ConversionResult::Invalid? Depends on the tests really.
There was a problem hiding this comment.
The Err(Error::JSFailed) branch is only for SameValue itself failing not for “seen contains input” when same == true
| } | ||
|
|
||
| // If input is a Date (has a [[DateValue]] internal slot): | ||
| if let ESClass::Date = built_in_class { |
| if !js::rust::wrappers2::DateGetMsecSinceEpoch(cx, object.handle(), &mut f) { | ||
| // 3.1. Let ms be the value of input's [[DateValue]] internal slot. | ||
| let mut ms = f64::NAN; | ||
| if !js::rust::wrappers2::DateGetMsecSinceEpoch(cx, object.handle(), &mut ms) { |
| let is_detached = if IsArrayBufferObject(*object) { | ||
| IsDetachedArrayBufferObject(*object) | ||
| } else { | ||
| let mut is_shared = false; |
There was a problem hiding this comment.
Note that we don't support it, so its false by default.
| } | ||
|
|
||
| // If input is an Array exotic object: | ||
| if let ESClass::Array = built_in_class { |
…xedDB spec and update WPT metadata Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>
ee1688a to
d556366
Compare
…xedDB spec (servo#43041) indexeddb: align getAll/getAllKeys and convert_value_to_key with IndexedDB spec and update WPT expectation Testing: more IndexedDB test are passing. part of servo#40983 Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>
indexeddb: align getAll/getAllKeys and convert_value_to_key with IndexedDB spec and update WPT expectation
Testing: more IndexedDB test are passing.
part of #40983