Describe the bug
Currently Utils.parseEscapedChars can match up to three backslashes in a replacement, which I think is unintended. As an example problem case, \\\\\\ unescapes to \\\\ instead of \\\. The reproduction link below does a round trip with escape, then unescape.
Following #582, I think we don't need the leading (\\)? and if (a === "\\") anymore. If there's an escaped backslash, it'll match with b equal to \, and whatever comes after will not be affected by the replace operation.
To Reproduce
- Version: 8.34.2
- Compile time: 28/06/2019 16:17:13 UTC
- User-Agent:
Mozilla/5.0 (X11; Linux x86_64; rv:67.0) Gecko/20100101 Firefox/67.0
- Link to reproduce
Expected behavior
The output should be \\\.
Describe the bug
Currently Utils.parseEscapedChars can match up to three backslashes in a replacement, which I think is unintended. As an example problem case,
\\\\\\unescapes to\\\\instead of\\\. The reproduction link below does a round trip with escape, then unescape.Following #582, I think we don't need the leading
(\\)?andif (a === "\\")anymore. If there's an escaped backslash, it'll match withbequal to\, and whatever comes after will not be affected by the replace operation.To Reproduce
Mozilla/5.0 (X11; Linux x86_64; rv:67.0) Gecko/20100101 Firefox/67.0
Expected behavior
The output should be
\\\.