mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-02 06:37:52 +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:
@@ -277,7 +277,7 @@ JS_DEFINE_NATIVE_FUNCTION(ObjectConstructor::get_own_property_descriptors)
|
||||
|
||||
// 4. For each element key of ownKeys, do
|
||||
for (auto& key : own_keys) {
|
||||
auto property_name = PropertyKey::from_value(global_object, key);
|
||||
auto property_name = MUST(PropertyKey::from_value(global_object, key));
|
||||
|
||||
// a. Let desc be ? obj.[[GetOwnProperty]](key).
|
||||
auto desc = TRY(object->internal_get_own_property(property_name));
|
||||
@@ -411,7 +411,7 @@ JS_DEFINE_NATIVE_FUNCTION(ObjectConstructor::assign)
|
||||
|
||||
// iii. For each element nextKey of keys, do
|
||||
for (auto& next_key : keys) {
|
||||
auto property_name = PropertyKey::from_value(global_object, next_key);
|
||||
auto property_name = MUST(PropertyKey::from_value(global_object, next_key));
|
||||
|
||||
// 1. Let desc be ? from.[[GetOwnProperty]](nextKey).
|
||||
auto desc = TRY(from->internal_get_own_property(property_name));
|
||||
|
||||
Reference in New Issue
Block a user