mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 04:25:13 +00:00
LibJS: Move Value::as_accessor() to Value.h
This commit is contained in:
parent
5a983c238b
commit
5b88aa8e96
Notes:
sideshowbarker
2024-07-19 05:46:45 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/5b88aa8e962 Pull-request: https://github.com/SerenityOS/serenity/pull/2509 Reviewed-by: https://github.com/alimpfard
2 changed files with 7 additions and 8 deletions
|
@ -62,12 +62,6 @@ Function& Value::as_function()
|
|||
return static_cast<Function&>(as_object());
|
||||
}
|
||||
|
||||
Accessor& Value::as_accessor()
|
||||
{
|
||||
ASSERT(is_accessor());
|
||||
return static_cast<Accessor&>(*m_value.as_accessor);
|
||||
}
|
||||
|
||||
String Value::to_string_without_side_effects() const
|
||||
{
|
||||
switch (m_type) {
|
||||
|
|
|
@ -201,10 +201,13 @@ public:
|
|||
return m_value.as_cell;
|
||||
}
|
||||
|
||||
String to_string_without_side_effects() const;
|
||||
Accessor& as_accessor()
|
||||
{
|
||||
ASSERT(is_accessor());
|
||||
return *m_value.as_accessor;
|
||||
}
|
||||
|
||||
Function& as_function();
|
||||
Accessor& as_accessor();
|
||||
|
||||
i32 as_i32() const;
|
||||
size_t as_size_t() const;
|
||||
|
@ -219,6 +222,8 @@ public:
|
|||
size_t to_size_t(Interpreter&) const;
|
||||
bool to_boolean() const;
|
||||
|
||||
String to_string_without_side_effects() const;
|
||||
|
||||
Value value_or(Value fallback) const
|
||||
{
|
||||
if (is_empty())
|
||||
|
|
Loading…
Add table
Reference in a new issue