mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-09 17:49:40 +00:00
LibJS: Add const Value::as_function()
This commit is contained in:
parent
2dba048146
commit
e14f420a44
Notes:
sideshowbarker
2024-07-18 03:27:46 +09:00
Author: https://github.com/linusg
Commit: e14f420a44
Pull-request: https://github.com/SerenityOS/serenity/pull/10203
Reviewed-by: https://github.com/IdanHo ✅
Reviewed-by: https://github.com/davidot
2 changed files with 7 additions and 0 deletions
|
@ -228,6 +228,12 @@ FunctionObject& Value::as_function()
|
||||||
return static_cast<FunctionObject&>(as_object());
|
return static_cast<FunctionObject&>(as_object());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FunctionObject const& Value::as_function() const
|
||||||
|
{
|
||||||
|
VERIFY(is_function());
|
||||||
|
return static_cast<FunctionObject const&>(as_object());
|
||||||
|
}
|
||||||
|
|
||||||
// 7.2.4 IsConstructor ( argument ), https://tc39.es/ecma262/#sec-isconstructor
|
// 7.2.4 IsConstructor ( argument ), https://tc39.es/ecma262/#sec-isconstructor
|
||||||
bool Value::is_constructor() const
|
bool Value::is_constructor() const
|
||||||
{
|
{
|
||||||
|
|
|
@ -240,6 +240,7 @@ public:
|
||||||
|
|
||||||
Array& as_array();
|
Array& as_array();
|
||||||
FunctionObject& as_function();
|
FunctionObject& as_function();
|
||||||
|
FunctionObject const& as_function() const;
|
||||||
|
|
||||||
i32 as_i32() const;
|
i32 as_i32() const;
|
||||||
u32 as_u32() const;
|
u32 as_u32() const;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue