mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:37:35 +00:00
LibJS: Pass prototype to Function constructors
This commit is contained in:
parent
205ac0090d
commit
f6d57c82f6
21 changed files with 66 additions and 24 deletions
|
@ -33,7 +33,9 @@ namespace JS {
|
|||
|
||||
class NativeFunction : public Function {
|
||||
public:
|
||||
explicit NativeFunction(const FlyString& name, AK::Function<Value(Interpreter&)>);
|
||||
static NativeFunction* create(Interpreter&, GlobalObject&, const FlyString& name, AK::Function<Value(Interpreter&)>);
|
||||
|
||||
explicit NativeFunction(const FlyString& name, AK::Function<Value(Interpreter&)>, Object& prototype);
|
||||
virtual ~NativeFunction() override;
|
||||
|
||||
virtual Value call(Interpreter&) override;
|
||||
|
@ -43,8 +45,8 @@ public:
|
|||
virtual bool has_constructor() const { return false; }
|
||||
|
||||
protected:
|
||||
NativeFunction(const FlyString& name);
|
||||
NativeFunction() {}
|
||||
NativeFunction(const FlyString& name, Object& prototype);
|
||||
explicit NativeFunction(Object& prototype);
|
||||
|
||||
private:
|
||||
virtual bool is_native_function() const override { return true; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue