1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:18:11 +00:00

LibJS: Add a missing exception check in Object.assign()

This commit is contained in:
Linus Groh 2021-07-05 17:20:50 +01:00
parent 2e94fa25d0
commit 34c28b981a

View file

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