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

LibJS: Convert internal_set_prototype_of() to ThrowCompletionOr

This commit is contained in:
Linus Groh 2021-09-28 23:54:42 +01:00
parent 5148150e1c
commit 8c81c84c18
20 changed files with 43 additions and 50 deletions

View file

@ -162,9 +162,7 @@ JS_DEFINE_NATIVE_FUNCTION(ObjectConstructor::set_prototype_of)
return object;
// 4. Let status be ? O.[[SetPrototypeOf]](proto).
auto status = object.as_object().internal_set_prototype_of(proto.is_null() ? nullptr : &proto.as_object());
if (vm.exception())
return {};
auto status = TRY_OR_DISCARD(object.as_object().internal_set_prototype_of(proto.is_null() ? nullptr : &proto.as_object()));
// 5. If status is false, throw a TypeError exception.
if (!status) {