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:
Linus Groh 2020-04-02 22:08:14 +01:00 committed by Andreas Kling
commit 2636cac6e4
Notes: sideshowbarker 2024-07-19 07:59:03 +09:00
6 changed files with 1 additions and 30 deletions

View file

@ -69,7 +69,6 @@ Lexer::Lexer(StringView source)
s_keywords.set("true", TokenType::BoolLiteral);
s_keywords.set("try", TokenType::Try);
s_keywords.set("typeof", TokenType::Typeof);
s_keywords.set("undefined", TokenType::UndefinedLiteral);
s_keywords.set("var", TokenType::Var);
s_keywords.set("void", TokenType::Void);
s_keywords.set("while", TokenType::While);