mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-03 15:16:14 +00:00
LibJS: Implement constructor/non-constructor function calls
This adds Function::construct() for constructor function calls via `new` keyword. NativeFunction doesn't have constructor behaviour by default, ScriptFunction simply calls call() in construct()
This commit is contained in:
committed by
Andreas Kling
parent
a27884e4be
commit
849e2c77e4
@@ -37,6 +37,9 @@ public:
|
||||
virtual ~NativeFunction() override;
|
||||
|
||||
virtual Value call(Interpreter&) override;
|
||||
virtual Value construct(Interpreter&) override;
|
||||
|
||||
virtual bool has_constructor() const { return false; }
|
||||
|
||||
protected:
|
||||
NativeFunction() {}
|
||||
|
||||
Reference in New Issue
Block a user