mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-15 23:01:52 +00:00
LibJS: Don't assume [[GetOwnPropertyDescriptor]] always succeeds
It can fail if we're talking to a badly-behaved proxy when enumerating object properties for iteration.
This commit is contained in:
parent
37c7eb14fe
commit
660d533b50
Notes:
github-actions[bot]
2025-03-20 17:52:44 +00:00
Author: https://github.com/awesomekling
Commit: 660d533b50
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4017
2 changed files with 14 additions and 0 deletions
|
@ -1732,6 +1732,8 @@ inline ThrowCompletionOr<Object*> get_object_property_iterator(VM& vm, Value val
|
|||
continue;
|
||||
|
||||
auto descriptor = TRY(object_to_check->internal_get_own_property(property_key));
|
||||
if (!descriptor.has_value())
|
||||
continue;
|
||||
if (!*descriptor->enumerable)
|
||||
non_enumerable_properties.set(move(property_key));
|
||||
else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue