mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +00:00
LibJS: Add bytecode support for regexp literals
This commit is contained in:
parent
3ccf4dc7ad
commit
df65ff8a1e
Notes:
sideshowbarker
2024-07-18 11:58:08 +09:00
Author: https://github.com/mattco98
Commit: df65ff8a1e
Pull-request: https://github.com/SerenityOS/serenity/pull/8164
Reviewed-by: https://github.com/alimpfard
Reviewed-by: https://github.com/awesomekling
Reviewed-by: https://github.com/linusg
5 changed files with 41 additions and 0 deletions
|
@ -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())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue