mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-24 00:24:38 +00:00
LibJS: Add bytecode support for regexp literals
This commit is contained in:
committed by
Andreas Kling
parent
3ccf4dc7ad
commit
df65ff8a1e
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user