mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:07:35 +00:00
LibJS: Check the target function of a bound function in is_constructor
This is not exactly compliant with the specification, but our current bound function implementation isn't either, so its not currently possible to implement it the way the specification requires.
This commit is contained in:
parent
1d94d7a367
commit
12e66de410
1 changed files with 3 additions and 1 deletions
|
@ -242,7 +242,9 @@ bool Value::is_constructor() const
|
|||
return false;
|
||||
if (is<NativeFunction>(as_object()))
|
||||
return static_cast<const NativeFunction&>(as_object()).has_constructor();
|
||||
// OrdinaryFunctionObject or BoundFunction
|
||||
if (is<BoundFunction>(as_object()))
|
||||
return Value(&static_cast<const BoundFunction&>(as_object()).target_function()).is_constructor();
|
||||
// OrdinaryFunctionObject
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue