Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests: Fixed polynomial backtracking test #2891

Merged
merged 1 commit into from
May 7, 2021

Conversation

RunDevelopment
Copy link
Member

Before this fix, parsing a regex required the regex the be a valid ES5 regex. This used to be fine as only language definition regexes were parsed but this changed recently with #2688. Now, all regexes and regex usages are tested. This makes everything safe but introduced a new problem.

When using "str".split(/regex/), the JS engine will create a temporary new regex with the y flag added. Obviously, the y flag isn't valid in ES5, so our backtracking tests fail for seemingly no reason.

The fix is simple: allow regexes of later JS versions.

I will immediately merge this because this blocks #2885.

@github-actions
Copy link

github-actions bot commented May 7, 2021

No JS Changes

Generated by 🚫 dangerJS against 8f5797f

@RunDevelopment RunDevelopment merged commit 8dbf121 into PrismJS:master May 7, 2021
@RunDevelopment RunDevelopment deleted the fxi-poly-bt-test branch May 7, 2021 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant