1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 03:57:43 +00:00

LibJS: Always keep a reference to the global object in Shape

We need to move towards supporting multiple global objects, which will
be a large refactoring. To keep it manageable, let's do it in steps,
starting with giving Object a way to find the GlobalObject it lives
inside by asking its Shape for it.
This commit is contained in:
Andreas Kling 2020-06-08 12:15:58 +02:00
parent 10aebabf0b
commit ff8bb962b6
5 changed files with 26 additions and 15 deletions

View file

@ -70,7 +70,7 @@ GlobalObject::GlobalObject()
void GlobalObject::initialize()
{
// These are done first since other prototypes depend on their presence.
m_empty_object_shape = heap().allocate<Shape>();
m_empty_object_shape = heap().allocate<Shape>(*this);
m_object_prototype = heap().allocate<ObjectPrototype>();
m_function_prototype = heap().allocate<FunctionPrototype>();