1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 17:17:45 +00:00

LibJS: Let Shape store a Realm instead of a GlobalObject

This is a cautious first step towards being able to create JS objects
before a global object has been instantiated.
This commit is contained in:
Andreas Kling 2022-08-01 20:27:20 +02:00
parent 7a6935a2ff
commit 50d951aea2
22 changed files with 104 additions and 55 deletions

View file

@ -47,7 +47,7 @@ public:
Prototype,
};
explicit Shape(Object& global_object);
explicit Shape(Realm&);
Shape(Shape& previous_shape, StringOrSymbol const& property_key, PropertyAttributes attributes, TransitionType);
Shape(Shape& previous_shape, Object* new_prototype);
@ -61,6 +61,7 @@ public:
bool is_unique() const { return m_unique; }
Shape* create_unique_clone() const;
Realm& realm() const { return m_realm; }
GlobalObject* global_object() const;
Object* prototype() { return m_prototype; }
@ -92,7 +93,7 @@ private:
void ensure_property_table() const;
Object* m_global_object { nullptr };
Realm& m_realm;
mutable OwnPtr<HashMap<StringOrSymbol, PropertyMetadata>> m_property_table;