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

chore: replace deprecated String.prototype.substr() #4852

Merged
merged 1 commit into from Mar 22, 2022
Merged

chore: replace deprecated String.prototype.substr() #4852

merged 1 commit into from Mar 22, 2022

Conversation

CommanderRoot
Copy link
Contributor

@CommanderRoot CommanderRoot commented Mar 18, 2022

Description of the Change

String.prototype.substr() is deprecated so we replace it with String.prototype.slice() which works similarily but isn't deprecated.
.substr() probably isn't going away anytime soon but the change is trivial so it doesn't hurt to do it.

Alternate Designs

It would also be possible to use substring() instead of slice()

Why should this be in core?

Best to not use deprecated functions

Benefits

No more deprecated functions

Possible Drawbacks

None

Applicable issues

None so far

.substr() is deprecated so we replace it with .slice() which works similarily but isn't deprecated
Signed-off-by: Tobias Speicher <rootcommander@gmail.com>
@coveralls
Copy link

@coveralls coveralls commented Mar 22, 2022

Coverage Status

Coverage remained the same at 94.465% when pulling 9ba2168 on CommanderRoot:fix/rm-deprecated-substr into d7f6ea5 on mochajs:master.

@juergba juergba added the run-browser-test label Mar 22, 2022
@github-actions github-actions bot removed the run-browser-test label Mar 22, 2022
@juergba juergba added browser reporter refactor labels Mar 22, 2022
@juergba juergba added this to the v10.0.0 milestone Mar 22, 2022
@juergba juergba merged commit a816130 into mochajs:master Mar 22, 2022
18 checks passed
@juergba juergba added the semver-patch label Mar 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
browser refactor reporter semver-patch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants