mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 00:57:45 +00:00
LibJS: Implement Object.freeze() and Object.seal()
This commit is contained in:
parent
1c3eef5317
commit
9af07c7803
8 changed files with 202 additions and 3 deletions
|
@ -84,6 +84,11 @@ public:
|
|||
DefineProperty,
|
||||
};
|
||||
|
||||
enum class IntegrityLevel {
|
||||
Sealed,
|
||||
Frozen,
|
||||
};
|
||||
|
||||
Shape& shape() { return *m_shape; }
|
||||
const Shape& shape() const { return *m_shape; }
|
||||
|
||||
|
@ -129,6 +134,8 @@ public:
|
|||
virtual bool is_extensible() const { return m_is_extensible; }
|
||||
virtual bool prevent_extensions();
|
||||
|
||||
bool set_integrity_level(IntegrityLevel);
|
||||
|
||||
virtual Value value_of() const { return Value(const_cast<Object*>(this)); }
|
||||
virtual Value ordinary_to_primitive(Value::PreferredType preferred_type) const;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue