1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 06:07:44 +00:00

LibJS: Stop inheriting from Set in SetPrototype

This makes sure that is<Set> checks done on the Set prototype instead of
on Set instances return false, thereby emulating the behaviour of the
RequireInternalSlot abstract operation.
This commit is contained in:
Idan Horowitz 2021-06-09 19:01:45 +03:00 committed by Linus Groh
parent 5d57384bc4
commit f437793788
4 changed files with 18 additions and 18 deletions

View file

@ -22,18 +22,6 @@ Set::~Set()
{
}
Set* Set::typed_this(VM& vm, GlobalObject& global_object)
{
auto* this_object = vm.this_value(global_object).to_object(global_object);
if (!this_object)
return {};
if (!is<Set>(this_object)) {
vm.throw_exception<TypeError>(global_object, ErrorType::NotA, "Set");
return nullptr;
}
return static_cast<Set*>(this_object);
}
void Set::visit_edges(Cell::Visitor& visitor)
{
Object::visit_edges(visitor);