diff options
Diffstat (limited to 'Userland/Libraries/LibJS/Bytecode/ASTCodegen.cpp')
-rw-r--r-- | Userland/Libraries/LibJS/Bytecode/ASTCodegen.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Userland/Libraries/LibJS/Bytecode/ASTCodegen.cpp b/Userland/Libraries/LibJS/Bytecode/ASTCodegen.cpp index c53f65289a..86c6990f53 100644 --- a/Userland/Libraries/LibJS/Bytecode/ASTCodegen.cpp +++ b/Userland/Libraries/LibJS/Bytecode/ASTCodegen.cpp @@ -258,6 +258,13 @@ void StringLiteral::generate_bytecode(Bytecode::Generator& generator) const generator.emit<Bytecode::Op::NewString>(generator.intern_string(m_value)); } +void RegExpLiteral::generate_bytecode(Bytecode::Generator& generator) const +{ + auto source_index = generator.intern_string(m_pattern); + auto flags_index = generator.intern_string(m_flags); + generator.emit<Bytecode::Op::NewRegExp>(source_index, flags_index); +} + void Identifier::generate_bytecode(Bytecode::Generator& generator) const { if (m_argument_index.has_value()) |