diff options
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/ECMAScriptFunctionObject.h')
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/ECMAScriptFunctionObject.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/ECMAScriptFunctionObject.h b/Userland/Libraries/LibJS/Runtime/ECMAScriptFunctionObject.h index 5dd9fd5d1f..a620e67aa7 100644 --- a/Userland/Libraries/LibJS/Runtime/ECMAScriptFunctionObject.h +++ b/Userland/Libraries/LibJS/Runtime/ECMAScriptFunctionObject.h @@ -58,6 +58,16 @@ public: Object* home_object() const { return m_home_object; } void set_home_object(Object* home_object) { m_home_object = home_object; } + struct InstanceField { + StringOrSymbol name; + ECMAScriptFunctionObject* initializer { nullptr }; + + void define_field(VM& vm, Object& receiver) const; + }; + + Vector<InstanceField> const& fields() const { return m_fields; } + void add_field(StringOrSymbol property_key, ECMAScriptFunctionObject* initializer) { m_fields.empend(property_key, initializer); } + protected: virtual bool is_strict_mode() const final { return m_strict; } @@ -77,6 +87,7 @@ private: ThisMode m_this_mode { ThisMode::Global }; // [[ThisMode]] bool m_strict { false }; // [[Strict]] Object* m_home_object { nullptr }; // [[HomeObject]] + Vector<InstanceField> m_fields; // [[Fields]] bool m_is_class_constructor { false }; // [[IsClassConstructor]] FlyString m_name; |