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

LibJS: Move the empty object shape from Interpreter to GlobalObject

The big remaining hurdle before a GlobalObject-agnostic Interpreter is
the fact that Interpreter owns and vends the GlobalObject :^)
This commit is contained in:
Andreas Kling 2020-04-18 13:56:13 +02:00
parent 75f6454de7
commit 3072f9fd82
5 changed files with 13 additions and 7 deletions

View file

@ -45,8 +45,12 @@ Object* Object::create_empty(Interpreter&, GlobalObject& global_object)
Object::Object(Object* prototype)
{
m_shape = interpreter().empty_object_shape();
set_prototype(prototype);
if (prototype) {
m_shape = interpreter().global_object().empty_object_shape();
set_prototype(prototype);
} else {
m_shape = interpreter().heap().allocate<Shape>();
}
}
Object::~Object()