LibJS: Implement null and undefined literals

This commit is contained in:
0xtechnobabble 2020-03-15 23:32:34 +02:00 committed by Andreas Kling
commit cfd710eb31
Notes: sideshowbarker 2024-07-19 08:16:59 +09:00
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)