diff options
author | Gunnar Beutner <gbeutner@serenityos.org> | 2021-06-07 20:47:26 +0200 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2021-06-07 20:06:46 +0100 |
commit | 9e69ffc1b1582b605afcdf8e4cc8369f0361b38f (patch) | |
tree | 23939bf046d121696a3a1c58a49feab3047f587e | |
parent | 2b8a2542a0c46f0eac02d49059f40f9cfb3a7976 (diff) | |
download | serenity-9e69ffc1b1582b605afcdf8e4cc8369f0361b38f.zip |
LibJS: Add bytecode generation for EmptyStatement
-rw-r--r-- | Userland/Libraries/LibJS/AST.h | 1 | ||||
-rw-r--r-- | Userland/Libraries/LibJS/Bytecode/ASTCodegen.cpp | 5 |
2 files changed, 6 insertions, 0 deletions
diff --git a/Userland/Libraries/LibJS/AST.h b/Userland/Libraries/LibJS/AST.h index 6420845308..15a792c9fd 100644 --- a/Userland/Libraries/LibJS/AST.h +++ b/Userland/Libraries/LibJS/AST.h @@ -76,6 +76,7 @@ public: { } Value execute(Interpreter&, GlobalObject&) const override { return {}; } + virtual Optional<Bytecode::Register> generate_bytecode(Bytecode::Generator&) const override; }; class ErrorStatement final : public Statement { diff --git a/Userland/Libraries/LibJS/Bytecode/ASTCodegen.cpp b/Userland/Libraries/LibJS/Bytecode/ASTCodegen.cpp index 1745f75e20..5440030c6f 100644 --- a/Userland/Libraries/LibJS/Bytecode/ASTCodegen.cpp +++ b/Userland/Libraries/LibJS/Bytecode/ASTCodegen.cpp @@ -27,6 +27,11 @@ Optional<Bytecode::Register> ScopeNode::generate_bytecode(Bytecode::Generator& g return {}; } +Optional<Bytecode::Register> EmptyStatement::generate_bytecode(Bytecode::Generator&) const +{ + return {}; +} + Optional<Bytecode::Register> ExpressionStatement::generate_bytecode(Bytecode::Generator& generator) const { return m_expression->generate_bytecode(generator); |