LibJS: Add ObjectPrototype and implement hasOwnProperty()

All Objects will now have ObjectPrototype as their prototype, unless
overridden.
This commit is contained in:
Andreas Kling 2020-03-15 15:25:43 +01:00
commit 23b1d97b0d
Notes: sideshowbarker 2024-07-19 08:17:46 +09:00
8 changed files with 114 additions and 0 deletions

View file

@ -54,6 +54,8 @@ public:
const Object* prototype() const { return m_prototype; }
void set_prototype(Object* prototype) { m_prototype = prototype; }
bool has_own_property(const String& property_name) const;
private:
HashMap<String, Value> m_properties;
Object* m_prototype { nullptr };