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

LibJS: Convert internal_get_prototype_of() to ThrowCompletionOr

This commit is contained in:
Linus Groh 2021-09-28 23:30:17 +01:00
parent c8bf7f9c41
commit 5148150e1c
14 changed files with 48 additions and 70 deletions

View file

@ -1654,9 +1654,7 @@ bool @class_name@::is_named_property_exposed_on_object(JS::PropertyName const& p
scoped_generator.append(R"~~~(
// NOTE: Step 3 is not here as the interface doesn't have the LegacyOverrideBuiltIns extended attribute.
// 4. Let prototype be O.[[GetPrototypeOf]]().
auto* prototype = internal_get_prototype_of();
if (vm.exception())
return {};
auto* prototype = TRY_OR_DISCARD(internal_get_prototype_of());
// 5. While prototype is not null:
while (prototype) {
@ -1670,9 +1668,7 @@ bool @class_name@::is_named_property_exposed_on_object(JS::PropertyName const& p
return false;
// 2. Set prototype to prototype.[[GetPrototypeOf]]().
prototype = prototype->internal_get_prototype_of();
if (vm.exception())
return {};
prototype = TRY_OR_DISCARD(prototype->internal_get_prototype_of());
}
// 6. Return true.