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

fix: skipFiles creating catastrophic regexes #1470

Merged
merged 1 commit into from
Dec 6, 2022
Merged

fix: skipFiles creating catastrophic regexes #1470

merged 1 commit into from
Dec 6, 2022

Conversation

connor4312
Copy link
Member

@connor4312 connor4312 commented Dec 6, 2022

The default skipFiles for extension host debugging create a pair of
regexes, which compile down to something like:

/^(.+(\\/|$))*node_modules\\.asar\\/(.+(\\/|$))*$/i

The former part of this regex is a catastrophic lookahead, taking ~250ms
to test against the string included in the unit tests in this PR.

This fixes that and also adds a sanity unit test to ensure regexes run
reasonably fast.

Fixes #1469

The default skipFiles for extension host debugging create a pair of
regexes, which compile down to something like:

```
/^(.+(\\/|$))*node_modules\\.asar\\/(.+(\\/|$))*$/i
```

The former part of this regex is a catastrophic lookahead, taking ~250ms
to test against the test string.

This fixes that and also adds a sanity unit test to ensure regexes run
reasonably fast.
@connor4312 connor4312 merged commit 2627bd1 into main Dec 6, 2022
@connor4312 connor4312 deleted the fix/1469 branch December 6, 2022 22:23
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.

JS debug extension causes extension development host to become unresponsive
2 participants