mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 09:00:22 +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
Notes:
sideshowbarker
2024-07-18 11:20:58 +09:00
Author: https://github.com/IdanHo Commit: https://github.com/SerenityOS/serenity/commit/12e66de410b Pull-request: https://github.com/SerenityOS/serenity/pull/8311 Reviewed-by: https://github.com/linusg
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…
Reference in a new issue