diff options
author | Linus Groh <mail@linusgroh.de> | 2021-07-05 17:20:50 +0100 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2021-07-05 18:19:45 +0100 |
commit | 34c28b981afb19f7be9d16268ff0f3730a806b56 (patch) | |
tree | 0b78bf63c03866bd9b534a2558b001e33c11ce7e | |
parent | 2e94fa25d0e9163c2f605fde3dd8fec9b428ce1c (diff) | |
download | serenity-34c28b981afb19f7be9d16268ff0f3730a806b56.zip |
LibJS: Add a missing exception check in Object.assign()
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/ObjectConstructor.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/ObjectConstructor.cpp b/Userland/Libraries/LibJS/Runtime/ObjectConstructor.cpp index 4d5af4a585..9412165c9d 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) |