mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +00:00
LibJS: Convert PropertyKey::from_value() to ThrowCompletionOr
Lots of MUST() - perhaps we'll eventually come up with a better API for the common case where it can't fail.
This commit is contained in:
parent
62356cff40
commit
29e96eceeb
Notes:
sideshowbarker
2024-07-17 21:38:37 +09:00
Author: https://github.com/linusg
Commit: 29e96eceeb
Pull-request: https://github.com/SerenityOS/serenity/pull/11626
Reviewed-by: https://github.com/IdanHo ✅
7 changed files with 23 additions and 25 deletions
|
@ -699,8 +699,10 @@ ThrowCompletionOr<MarkedValueList> ProxyObject::internal_own_property_keys() con
|
|||
|
||||
// 16. For each element key of targetKeys, do
|
||||
for (auto& key : target_keys) {
|
||||
auto property_key = MUST(PropertyKey::from_value(global_object, key));
|
||||
|
||||
// a. Let desc be ? target.[[GetOwnProperty]](key).
|
||||
auto descriptor = TRY(m_target.internal_get_own_property(PropertyKey::from_value(global_object, key)));
|
||||
auto descriptor = TRY(m_target.internal_get_own_property(property_key));
|
||||
|
||||
// b. If desc is not undefined and desc.[[Configurable]] is false, then
|
||||
if (descriptor.has_value() && !*descriptor->configurable) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue