mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:47:45 +00:00
LibJS: Disallow changing the prototype of non-extensible objects
Object::set_prototype() now returns a boolean indicating success. Setting the prototype to an identical object is always considered successful, even if the object is non-extensible.
This commit is contained in:
parent
8cf1ded478
commit
b958e4f573
4 changed files with 22 additions and 6 deletions
|
@ -95,7 +95,7 @@ public:
|
|||
|
||||
Object* prototype();
|
||||
const Object* prototype() const;
|
||||
void set_prototype(Object*);
|
||||
bool set_prototype(Object* prototype);
|
||||
bool has_prototype(const Object* prototype) const;
|
||||
|
||||
bool is_extensible() const { return m_is_extensible; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue