mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 03:57:44 +00:00
LibJS: Make native function/property callbacks take VM, not Interpreter
More work on decoupling the general runtime from Interpreter. The goal is becoming clearer. Interpreter should be one possible way to execute code inside a VM. In the future we might have other ways :^)
This commit is contained in:
parent
1ff9d33131
commit
340a115dfe
64 changed files with 1160 additions and 1114 deletions
|
@ -33,17 +33,17 @@ namespace JS {
|
|||
|
||||
class NativeProperty final : public Cell {
|
||||
public:
|
||||
NativeProperty(AK::Function<Value(Interpreter&, GlobalObject&)> getter, AK::Function<void(Interpreter&, GlobalObject&, Value)> setter);
|
||||
NativeProperty(AK::Function<Value(VM&, GlobalObject&)> getter, AK::Function<void(VM&, GlobalObject&, Value)> setter);
|
||||
virtual ~NativeProperty() override;
|
||||
|
||||
Value get(Interpreter&, GlobalObject&) const;
|
||||
void set(Interpreter&, GlobalObject&, Value);
|
||||
Value get(VM&, GlobalObject&) const;
|
||||
void set(VM&, GlobalObject&, Value);
|
||||
|
||||
private:
|
||||
virtual const char* class_name() const override { return "NativeProperty"; }
|
||||
|
||||
AK::Function<Value(Interpreter&, GlobalObject&)> m_getter;
|
||||
AK::Function<void(Interpreter&, GlobalObject&, Value)> m_setter;
|
||||
AK::Function<Value(VM&, GlobalObject&)> m_getter;
|
||||
AK::Function<void(VM&, GlobalObject&, Value)> m_setter;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue