1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 14:28:12 +00:00

LibJS: Convert define_properties() to ThrowCompletionOr

This commit is contained in:
Linus Groh 2021-10-03 19:54:37 +01:00
parent 0a49a2db60
commit 3b59a4577d
3 changed files with 12 additions and 12 deletions

View file

@ -354,7 +354,7 @@ JS_DEFINE_NATIVE_FUNCTION(ObjectConstructor::define_properties)
}
// 2. Return ? ObjectDefineProperties(O, Properties).
return object.as_object().define_properties(properties);
return TRY_OR_DISCARD(object.as_object().define_properties(properties));
}
// 20.1.2.13 Object.is ( value1, value2 ), https://tc39.es/ecma262/#sec-object.is
@ -411,7 +411,7 @@ JS_DEFINE_NATIVE_FUNCTION(ObjectConstructor::create)
// 3. If Properties is not undefined, then
if (!properties.is_undefined()) {
// a. Return ? ObjectDefineProperties(obj, Properties).
return object->define_properties(properties);
return TRY_OR_DISCARD(object->define_properties(properties));
}
// 4. Return obj.