1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 13:48:12 +00:00

LibJS: Convert has_property() to ThrowCompletionOr

This commit is contained in:
Linus Groh 2021-10-03 02:00:39 +01:00
parent a29b7a3ec7
commit f38a5957bf
11 changed files with 53 additions and 135 deletions

View file

@ -225,9 +225,7 @@ ThrowCompletionOr<Vector<String>> canonicalize_locale_list(GlobalObject& global_
auto property_key = PropertyName { k };
// b. Let kPresent be ? HasProperty(O, Pk).
auto key_present = object->has_property(property_key);
if (auto* exception = vm.exception())
return throw_completion(exception->value());
auto key_present = TRY(object->has_property(property_key));
// c. If kPresent is true, then
if (key_present) {