Skip to content

Add regression test for stable global regex evaluation#449

Open
matsgeyskens1234-lgtm wants to merge 1 commit into
vercel:mainfrom
matsgeyskens1234-lgtm:patch-1
Open

Add regression test for stable global regex evaluation#449
matsgeyskens1234-lgtm wants to merge 1 commit into
vercel:mainfrom
matsgeyskens1234-lgtm:patch-1

Conversation

@matsgeyskens1234-lgtm

Copy link
Copy Markdown

Adds a regression test ensuring repeated REGEX evaluation with the global
flag remains stable and returns RULE_MATCH consistently.

@vercel

vercel Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

@matsgeyskens1234-lgtm is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.

@vercel vercel Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional Suggestion:

Cached compiled RegExp with the g/y flag retains a stateful lastIndex, so repeated .test() calls on the same cached instance return alternating (inconsistent) results for the same input.

Fix on Vercel

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.

1 participant