LibJS: Port RegExp flags and patterns to UTF-16

This commit is contained in:
Timothy Flynn 2025-08-06 11:28:18 -04:00 committed by Tim Flynn
commit 62d85dd90a
Notes: github-actions[bot] 2025-08-13 13:57:14 +00:00
8 changed files with 55 additions and 46 deletions

View file

@ -444,8 +444,8 @@ Bytecode::CodeGenerationErrorOr<Optional<ScopedOperand>> StringLiteral::generate
Bytecode::CodeGenerationErrorOr<Optional<ScopedOperand>> RegExpLiteral::generate_bytecode(Bytecode::Generator& generator, Optional<ScopedOperand> preferred_dst) const
{
Bytecode::Generator::SourceLocationScope scope(generator, *this);
auto source_index = generator.intern_string(m_pattern);
auto flags_index = generator.intern_string(m_flags);
auto source_index = generator.intern_string(m_pattern.to_utf8_but_should_be_ported_to_utf16());
auto flags_index = generator.intern_string(m_flags.to_utf8_but_should_be_ported_to_utf16());
auto regex_index = generator.intern_regex(Bytecode::ParsedRegex {
.regex = m_parsed_regex,
.pattern = m_parsed_pattern,