mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 20:59:16 +00:00
LibJS: Add a missing exception check in Object.assign()
This commit is contained in:
parent
2e94fa25d0
commit
34c28b981a
Notes:
sideshowbarker
2024-07-18 10:22:13 +09:00
Author: https://github.com/linusg
Commit: 34c28b981a
Pull-request: https://github.com/SerenityOS/serenity/pull/8463
Reviewed-by: https://github.com/IdanHo ✅
1 changed files with 2 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue