Skip to content

fix(codegen): verify U+2028/U+2029 sourcemap panic fix is correct#19549

Closed
Copilot wants to merge 1 commit intoc/02-19-fix_codegen_avoid_sourcemap_panic_on_u_2028___u_2029_from
copilot/sub-pr-19548
Closed

fix(codegen): verify U+2028/U+2029 sourcemap panic fix is correct#19549
Copilot wants to merge 1 commit intoc/02-19-fix_codegen_avoid_sourcemap_panic_on_u_2028___u_2029_from
copilot/sub-pr-19548

Conversation

Copy link
Contributor

Copilot AI commented Feb 19, 2026

Addresses a review concern that the LS/PS sourcemap panic fix in #19548 may have been reviewed against an older, unpatched version of the code.

Verification

Confirmed the current update_generated_line_and_column implementation correctly handles LS (U+2028) and PS (U+2029) — the LS_OR_PS_FIRST_BYTE branch returns 3 as line_break_byte_len, advancing both line_start_index and idx past all 3 bytes of the sequence. This prevents from_utf8(&output[line_start_index..]) from receiving a slice starting mid-codepoint and panicking.

The test cases added in #19548 exercise the fix:

create_mappings("\u{2028}", 1, 0);
create_mappings("\u{2029}", 1, 0);
create_mappings("a\u{2028}b", 1, 1);
create_mappings("a\u{2029}b", 1, 1);
create_mappings("`\u{2028}`", 1, 1);
create_mappings("`\u{2029}`", 1, 1);

All 9 sourcemap_builder tests pass.


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Copilot AI changed the title [WIP] Address feedback on sourcemap panic fix for U+2028/U+2029 fix(codegen): verify U+2028/U+2029 sourcemap panic fix is correct Feb 19, 2026
Copilot AI requested a review from camc314 February 19, 2026 17:12
@camc314 camc314 closed this Feb 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants