From 34c28b981afb19f7be9d16268ff0f3730a806b56 Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Mon, 5 Jul 2021 17:20:50 +0100 Subject: [PATCH] LibJS: Add a missing exception check in Object.assign() --- Userland/Libraries/LibJS/Runtime/ObjectConstructor.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Userland/Libraries/LibJS/Runtime/ObjectConstructor.cpp b/Userland/Libraries/LibJS/Runtime/ObjectConstructor.cpp index 4d5af4a585d..9412165c9d3 100644 --- a/Userland/Libraries/LibJS/Runtime/ObjectConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/ObjectConstructor.cpp @@ -458,6 +458,8 @@ JS_DEFINE_NATIVE_FUNCTION(ObjectConstructor::assign) // 1. Let desc be ? from.[[GetOwnProperty]](nextKey). auto desc = from->internal_get_own_property(property_name); + if (vm.exception()) + return {}; // 2. If desc is not undefined and desc.[[Enumerable]] is true, then if (!desc.has_value() || !*desc->enumerable)