mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
LibRegex: Respect V8 astral literal lastIndex behavior
Preserve V8's behavior for bare single-astral literals when a unicode
global search starts in the middle of a surrogate pair. We were
snapping that lastIndex back to the pair start unconditionally,
which let /😀/gu and /\u{1F600}/gu match where V8 returns null.
Expose that literal shape from LibRegex to LibJS and add runtime
coverage for the bare literal case alongside a grouped control.
This commit is contained in:
committed by
Ali Mohammad Pur
parent
29c2fb9574
commit
f627b7dcbb
Notes:
github-actions[bot]
2026-03-27 16:33:38 +00:00
Author: https://github.com/awesomekling Commit: https://github.com/LadybirdBrowser/ladybird/commit/f627b7dcbb8 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/8612 Reviewed-by: https://github.com/jdahlin Reviewed-by: https://github.com/trflynn89
@@ -90,6 +90,11 @@ unsigned int ECMAScriptRegex::total_groups() const
|
||||
return m_impl->rust_regex.total_groups();
|
||||
}
|
||||
|
||||
bool ECMAScriptRegex::is_single_non_bmp_literal() const
|
||||
{
|
||||
return m_impl->rust_regex.is_single_non_bmp_literal();
|
||||
}
|
||||
|
||||
Vector<ECMAScriptNamedCaptureGroup> const& ECMAScriptRegex::named_groups() const
|
||||
{
|
||||
return m_impl->named_groups;
|
||||
|
||||
Reference in New Issue
Block a user