mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
LibJS: Allow the dumping of literals that aren't numbers
This commit is contained in:
parent
0d17e3bfa6
commit
3fb0ff102c
Notes:
sideshowbarker
2024-07-19 08:50:55 +09:00
Author: https://github.com/0xtechnobabble Commit: https://github.com/SerenityOS/serenity/commit/3fb0ff102c4 Pull-request: https://github.com/SerenityOS/serenity/pull/1380
1 changed files with 7 additions and 1 deletions
|
@ -138,7 +138,13 @@ void CallExpression::dump(int indent) const
|
|||
void Literal::dump(int indent) const
|
||||
{
|
||||
print_indent(indent);
|
||||
printf("%d\n", (i32)m_value.as_double());
|
||||
if (m_value.is_object())
|
||||
ASSERT_NOT_REACHED();
|
||||
|
||||
if (m_value.is_string())
|
||||
printf("%s\n", m_value.as_string()->characters());
|
||||
else
|
||||
printf("%s\n", m_value.to_string().characters());
|
||||
}
|
||||
|
||||
void FunctionDeclaration::dump(int indent) const
|
||||
|
|
Loading…
Reference in a new issue