LibJS: Convert define_properties() to ThrowCompletionOr

This commit is contained in:
Linus Groh 2021-10-03 19:54:37 +01:00
commit 3b59a4577d
Notes: sideshowbarker 2024-07-18 03:20:18 +09:00
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.