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:
parent
7aad10d984
commit
cfd710eb31
6 changed files with 61 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue