1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 09:48:11 +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:
Linus Groh 2022-01-04 22:33:30 +01:00
parent 62356cff40
commit 29e96eceeb
7 changed files with 23 additions and 25 deletions

View file

@ -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) {