From eb5c92d4e20d66ea13a1daeb48599b46359f60dd Mon Sep 17 00:00:00 2001 From: Ali Mohammad Pur Date: Mon, 21 Jun 2021 08:40:57 +0430 Subject: [PATCH] LibJS: Don't assert for empty reciever if AllowSideEffects::No is given This parameter is only used if AllowSideEffects::Yes, so there's no reason to pass anything to it if that's not used. --- Userland/Libraries/LibJS/Runtime/Object.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibJS/Runtime/Object.cpp b/Userland/Libraries/LibJS/Runtime/Object.cpp index 2bf1f05785..cd7e94d09d 100644 --- a/Userland/Libraries/LibJS/Runtime/Object.cpp +++ b/Userland/Libraries/LibJS/Runtime/Object.cpp @@ -251,7 +251,6 @@ bool Object::test_integrity_level(IntegrityLevel level) Value Object::get_own_property(const PropertyName& property_name, Value receiver, AllowSideEffects allow_side_effects) const { VERIFY(property_name.is_valid()); - VERIFY(!receiver.is_empty()); Value value_here; @@ -269,6 +268,7 @@ Value Object::get_own_property(const PropertyName& property_name, Value receiver VERIFY(!value_here.is_empty()); if (allow_side_effects == AllowSideEffects::Yes) { + VERIFY(!receiver.is_empty()); if (value_here.is_accessor()) return value_here.as_accessor().call_getter(receiver); if (value_here.is_native_property())