1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 07:57:46 +00:00

LibJS: Move has_constructor() from NativeFunction to FunctionObject

At a later point this will indicate whether some FunctionObject "has a
[[Construct]] internal method" (separate from the current FunctionObject
call() / construct()), to help with a more spec-compliant implementation
of [[Call]] and [[Construct]].
This means that it is no longer relevant to just NativeFunction.
This commit is contained in:
Linus Groh 2021-09-25 09:52:49 +02:00
parent e14f420a44
commit 38157a6093
7 changed files with 16 additions and 11 deletions

View file

@ -23,6 +23,7 @@ public:
virtual FunctionEnvironment* create_environment(FunctionObject&) override;
virtual const FlyString& name() const override { return m_name; }
virtual bool is_strict_mode() const override { return m_bound_target_function->is_strict_mode(); }
virtual bool has_constructor() const override { return true; }
FunctionObject& bound_target_function() const { return *m_bound_target_function; }
Value bound_this() const { return m_bound_this; }