1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 23:48:11 +00:00

LibJS: Add const Value::as_function()

This commit is contained in:
Linus Groh 2021-09-25 09:43:34 +02:00
parent 2dba048146
commit e14f420a44
2 changed files with 7 additions and 0 deletions

View file

@ -228,6 +228,12 @@ FunctionObject& Value::as_function()
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
bool Value::is_constructor() const
{