From ee8380edeabf822cf194eacaf081b801deea6c3a Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Wed, 29 Sep 2021 18:58:03 +0100 Subject: LibJS: Convert internal_own_property_keys() to ThrowCompletionOr --- Userland/Libraries/LibJS/Runtime/ReflectObject.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'Userland/Libraries/LibJS/Runtime/ReflectObject.cpp') diff --git a/Userland/Libraries/LibJS/Runtime/ReflectObject.cpp b/Userland/Libraries/LibJS/Runtime/ReflectObject.cpp index dc5dd1812d..8014263fb9 100644 --- a/Userland/Libraries/LibJS/Runtime/ReflectObject.cpp +++ b/Userland/Libraries/LibJS/Runtime/ReflectObject.cpp @@ -261,9 +261,7 @@ JS_DEFINE_NATIVE_FUNCTION(ReflectObject::own_keys) } // 2. Let keys be ? target.[[OwnPropertyKeys]](). - auto keys = target.as_object().internal_own_property_keys(); - if (vm.exception()) - return {}; + auto keys = TRY_OR_DISCARD(target.as_object().internal_own_property_keys()); // 3. Return CreateArrayFromList(keys). return Array::create_from(global_object, keys); -- cgit v1.2.3