瀏覽代碼

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

Linus Groh 4 年之前
父節點
當前提交
34c28b981a
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      Userland/Libraries/LibJS/Runtime/ObjectConstructor.cpp

+ 2 - 0
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)