1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 12:48:10 +00:00

LibJS: Implement null and undefined literals

This commit is contained in:
0xtechnobabble 2020-03-15 23:32:34 +02:00 committed by Andreas Kling
parent 7aad10d984
commit cfd710eb31
6 changed files with 61 additions and 0 deletions

View file

@ -380,6 +380,34 @@ private:
String m_value;
};
class NullLiteral final : public Literal {
public:
explicit NullLiteral()
{
}
virtual Value execute(Interpreter&) const override;
virtual void dump(int indent) const override;
private:
virtual const char* class_name() const override { return "NullLiteral"; }
String m_value;
};
class UndefinedLiteral final : public Literal {
public:
explicit UndefinedLiteral()
{
}
virtual Value execute(Interpreter&) const override;
virtual void dump(int indent) const override;
private:
virtual const char* class_name() const override { return "UndefinedLiteral"; }
};
class Identifier final : public Expression {
public:
explicit Identifier(String string)