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

LibJS: Add Object.{isExtensible,preventExtensions}()

This commit is contained in:
Matthew Olsson 2020-06-01 21:13:16 -07:00 committed by Andreas Kling
parent daa3f59a55
commit d5ae73a63b
6 changed files with 118 additions and 0 deletions

View file

@ -98,6 +98,9 @@ public:
void set_prototype(Object*);
bool has_prototype(const Object* prototype) const;
bool is_extensible() const { return m_is_extensible; }
bool prevent_extensions();
virtual Value value_of() const { return Value(const_cast<Object*>(this)); }
virtual Value to_primitive(Value::PreferredType preferred_type = Value::PreferredType::Default) const;
virtual Value to_string() const;
@ -122,6 +125,7 @@ private:
void set_shape(Shape&);
void ensure_shape_is_unique();
bool m_is_extensible { true };
Shape* m_shape { nullptr };
Vector<Value> m_storage;
IndexedProperties m_indexed_properties;