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

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

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 run browser tests on forked PR if code is safe label Mar 22, 2022
@github-actions github-actions bot removed the run-browser-test run browser tests on forked PR if code is safe label Mar 22, 2022
@juergba juergba added area: browser browser-specific area: reporters involving a specific reporter type: cleanup a 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
@juergba juergba added the semver-patch implementation requires increase of "patch" version number; "bug fixes" label Mar 22, 2022
This was referenced Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: browser browser-specific area: reporters involving a specific reporter semver-patch implementation requires increase of "patch" version number; "bug fixes" type: cleanup a refactor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants