mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-05 23:59:49 +00:00
LibJS: Remove UndefinedLiteral, add undefined to global object
There is no such thing as a "undefined literal" in JS - undefined is just a property on the global object with a value of undefined. This is pretty similar to NaN. var undefined = "foo"; is a perfectly fine AssignmentExpression :^)
This commit is contained in:
parent
543c6e00db
commit
2636cac6e4
Notes:
sideshowbarker
2024-07-19 07:59:03 +09:00
Author: https://github.com/linusg
Commit: 2636cac6e4
Pull-request: https://github.com/SerenityOS/serenity/pull/1591
Reviewed-by: https://github.com/awesomekling ✅
6 changed files with 1 additions and 30 deletions
|
@ -490,12 +490,6 @@ void BooleanLiteral::dump(int indent) const
|
|||
printf("BooleanLiteral %s\n", m_value ? "true" : "false");
|
||||
}
|
||||
|
||||
void UndefinedLiteral::dump(int indent) const
|
||||
{
|
||||
print_indent(indent);
|
||||
printf("undefined\n");
|
||||
}
|
||||
|
||||
void NullLiteral::dump(int indent) const
|
||||
{
|
||||
print_indent(indent);
|
||||
|
@ -812,11 +806,6 @@ Value BooleanLiteral::execute(Interpreter&) const
|
|||
return Value(m_value);
|
||||
}
|
||||
|
||||
Value UndefinedLiteral::execute(Interpreter&) const
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
Value NullLiteral::execute(Interpreter&) const
|
||||
{
|
||||
return js_null();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue