Closed Bug 1746645 Opened 3 years ago Closed 3 years ago

Generate EscapeChars array programmatically

Categories

(Core :: XPCOM, task)

task

Tracking

()

RESOLVED FIXED
98 Branch
Tracking Status
firefox98 --- fixed

People

(Reporter: emz, Assigned: emz)

References

Details

Attachments

(1 file)

The array used for excluding characters from being escaped is very difficult to read. This could introduce bugs in the future, because it's really hard to see exactly which characters are actually excluded for which flag. Updating the table is also tedious.

https://searchfox.org/mozilla-central/rev/5e15e00fa247cba5b765727496619bf9010ed162/xpcom/io/nsEscape.cpp#260-273

We can improve readability by programmatically generating the EscapeChars array.

I'll work on a patch based on :nika's draft here: https://hg.mozilla.org/try/rev/3d3d08be467cde22c974d8f8e2bf8243a2f8496f

Attachment #9259520 - Attachment description: WIP: Bug 1746645 - Generate EscapeChars array programmatically. r=xpcom-reviewers! → Bug 1746645 - Generate EscapeChars array programmatically. r=xpcom-reviewers!
Blocks: 1750945
Attachment #9259520 - Attachment description: Bug 1746645 - Generate EscapeChars array programmatically. r=xpcom-reviewers! → Bug 1746645 - Generate EscapeChars array programmatically. r=#xpcom-reviewers!
Pushed by pzuhlcke@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/681f7e6f3ff0 Generate EscapeChars array programmatically. r=xpcom-reviewers,nika
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 98 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: