mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 11:38:11 +00:00
LibJS: Replace $gc() hack with a NativeFunction on the global object
To make this work, also start passing Interpreter& to native functions.
This commit is contained in:
parent
9ad17d4674
commit
d1d136b4e5
5 changed files with 12 additions and 12 deletions
|
@ -33,16 +33,16 @@ namespace JS {
|
|||
|
||||
class NativeFunction final : public Object {
|
||||
public:
|
||||
explicit NativeFunction(AK::Function<Value(Vector<Argument>)>);
|
||||
explicit NativeFunction(AK::Function<Value(Interpreter&, Vector<Argument>)>);
|
||||
virtual ~NativeFunction() override;
|
||||
|
||||
AK::Function<Value(Vector<Argument>)>& native_function() { return m_native_function; }
|
||||
AK::Function<Value(Interpreter&, Vector<Argument>)>& native_function() { return m_native_function; }
|
||||
|
||||
private:
|
||||
virtual bool is_native_function() const override { return true; }
|
||||
virtual const char* class_name() const override { return "NativeFunction"; }
|
||||
|
||||
AK::Function<Value(Vector<Argument>)> m_native_function;
|
||||
AK::Function<Value(Interpreter&, Vector<Argument>)> m_native_function;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue