Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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 <[email protected]>
@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
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