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

Use replaceAll instead of an incorrect RegExp for tsserver log sanitization. #54454

Merged
merged 1 commit into from May 30, 2023

Conversation

DanielRosenwasser
Copy link
Member

@DanielRosenwasser DanielRosenwasser commented May 30, 2023

Today we use the TypeScript version as a raw input string for a RegExp and run it over TSServer logs. But that means that when you switch the version to 5.1.2 a whole bunch of random strings with 5 and 1 and 2 in them are replaced with FakeVersion because we're really running /5.1.2/g over the logs (which is 5{AnyCharacter}1{AnyCharacter}2).

So this PR avoids constructing the incorrect RegExp by using a replaceAll function which uses the newer built-in if it's available.

@DanielRosenwasser
Copy link
Member Author

@typescript-bot cherry-pick this to release-5.1

@typescript-bot
Copy link
Collaborator

typescript-bot commented May 30, 2023

Heya @DanielRosenwasser, I've started to run the task to cherry-pick this into release-5.1 on this PR at 2a9c204. You can monitor the build here.

@DanielRosenwasser DanielRosenwasser merged commit 63a210b into main May 30, 2023
20 checks passed
@DanielRosenwasser DanielRosenwasser deleted the sanitizeWithReplaceAll branch May 30, 2023 19:51
@typescript-bot
Copy link
Collaborator

Hey @DanielRosenwasser, I've opened #54456 for you.

typescript-bot pushed a commit to typescript-bot/TypeScript that referenced this pull request May 30, 2023
Component commits:
2a9c204 Use `replaceAll` instead of an incorrect `RegExp` for tsserver log sanitization.
DanielRosenwasser added a commit that referenced this pull request May 30, 2023
…e-5.1 (#54456)

Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants