mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:27:43 +00:00
LibJS: Make NativeProperty a plain Cell instead of an Object
This removes the need for NativeProperty objects to have a prototype, which just made things confusing.
This commit is contained in:
parent
ba641e97d9
commit
0166a1fa74
6 changed files with 33 additions and 25 deletions
|
@ -31,18 +31,16 @@
|
|||
|
||||
namespace JS {
|
||||
|
||||
class NativeProperty final : public Object {
|
||||
JS_OBJECT(NativeProperty, Object);
|
||||
|
||||
class NativeProperty final : public Cell {
|
||||
public:
|
||||
NativeProperty(GlobalObject&, AK::Function<Value(Interpreter&, GlobalObject&)> getter, AK::Function<void(Interpreter&, GlobalObject&, Value)> setter);
|
||||
NativeProperty(AK::Function<Value(Interpreter&, GlobalObject&)> getter, AK::Function<void(Interpreter&, GlobalObject&, Value)> setter);
|
||||
virtual ~NativeProperty() override;
|
||||
|
||||
Value get(Interpreter&, GlobalObject&) const;
|
||||
void set(Interpreter&, GlobalObject&, Value);
|
||||
|
||||
private:
|
||||
virtual bool is_native_property() const override { return true; }
|
||||
virtual const char* class_name() const override { return "NativeProperty"; }
|
||||
|
||||
AK::Function<Value(Interpreter&, GlobalObject&)> m_getter;
|
||||
AK::Function<void(Interpreter&, GlobalObject&, Value)> m_setter;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue