mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 05:08:13 +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
6 changed files with 1 additions and 30 deletions
|
@ -329,9 +329,6 @@ NonnullRefPtr<Expression> Parser::parse_primary_expression()
|
|||
case TokenType::NullLiteral:
|
||||
consume();
|
||||
return create_ast_node<NullLiteral>();
|
||||
case TokenType::UndefinedLiteral:
|
||||
consume();
|
||||
return create_ast_node<UndefinedLiteral>();
|
||||
case TokenType::CurlyOpen:
|
||||
return parse_object_expression();
|
||||
case TokenType::Function:
|
||||
|
@ -821,7 +818,6 @@ bool Parser::match_expression() const
|
|||
return type == TokenType::BoolLiteral
|
||||
|| type == TokenType::NumericLiteral
|
||||
|| type == TokenType::StringLiteral
|
||||
|| type == TokenType::UndefinedLiteral
|
||||
|| type == TokenType::NullLiteral
|
||||
|| type == TokenType::Identifier
|
||||
|| type == TokenType::New
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue