mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +00:00
LibWeb/Storage: Return undefined for non-existent key/index access
All tests at now pass: http://wpt.live/webstorage/defineProperty.window.html
This commit is contained in:
parent
c10cb8ac8d
commit
7a66316297
Notes:
github-actions[bot]
2024-10-23 17:32:41 +00:00
Author: https://github.com/BroadbentJim
Commit: 7a66316297
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1889
Reviewed-by: https://github.com/ADKaster ✅
Reviewed-by: https://github.com/gmta
3 changed files with 14 additions and 1 deletions
|
@ -182,7 +182,9 @@ JS::Value Storage::named_item_value(FlyString const& name) const
|
|||
{
|
||||
auto value = get_item(name);
|
||||
if (!value.has_value())
|
||||
return JS::js_null();
|
||||
// AD-HOC: Spec leaves open to a description at: https://html.spec.whatwg.org/multipage/webstorage.html#the-storage-interface
|
||||
// However correct behavior expected here: https://github.com/whatwg/html/issues/8684
|
||||
return JS::js_undefined();
|
||||
return JS::PrimitiveString::create(vm(), value.release_value());
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue