From e796770e7a630c924aeec8aa201def878e8906d4 Mon Sep 17 00:00:00 2001 From: Pierre Le Fevre Date: Sun, 22 Mar 2026 14:45:04 +0100 Subject: [PATCH] Fix Dot matching to use is_line_terminator for all ECMAScript line terminators The Dot (.) without the s flag should not match U+2028 (LINE SEPARATOR) and U+2029 (PARAGRAPH SEPARATOR) per the ECMAScript spec, not just \n and \r. Use the existing is_line_terminator helper for consistency. Co-Authored-By: Claude Opus 4.6 (1M context) --- crates/js/src/regex.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/js/src/regex.rs b/crates/js/src/regex.rs index 2342ddd..c4decfe 100644 --- a/crates/js/src/regex.rs +++ b/crates/js/src/regex.rs @@ -785,7 +785,7 @@ fn match_node(ctx: &mut MatchContext, node: &Node, pos: usize) -> Option Node::Dot => { if pos < ctx.chars.len() { let ch = ctx.chars[pos]; - if ctx.flags.dot_all || (ch != '\n' && ch != '\r') { + if ctx.flags.dot_all || !is_line_terminator(ch) { Some(pos + 1) } else { None -- 2.51.2