Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(PUP-11515) Negative Lookbehind Regex Causes Duplicate Node
Before this commit, two nodes could collide due to the lookaround Regex pattern. This issue arose because the regex was converted to a regular string by ignoring characters other than a-z, 0-9, _, and -. For example, /(?<!a)sync/ was converted to "__node_regexp__async," and /async/ was also converted to "__node_regexp__async," causing an error that the node was already defined. To prevent such duplication, this commit normalize the lookarround pattern from the regex, ensuring a unique string in case of lookarround pattern conflict. For example, /(?<!a)sync/ will converted to "__node_regexp__LPQULTEXaRPsync" replacing (?<!a) to "LPQULTEXaRP" while converting to the string.
- Loading branch information