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

Replace deprecated String.prototype.substr usage #2951

Merged
merged 1 commit into from
Dec 11, 2024

Conversation

scrhartley
Copy link
Contributor

Description

Inspired by the already merged in extensions PR #100.

On String, the substr method is deprecated and is not part of the main ECMAScript specification
(see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substr).
Replace with the alternatives slice and substring, which are both already used in the codebase.

Testing

I made sure that giving bad values caused the existing test cases to fail.
I temporarily added additionally logging to verify that it was doing what I expected.
I checked that most of the changes are trivial so that this could be considered as a single change.

Checklist

  • I have read the contribution guidelines
  • I have targeted this PR against the correct branch (master for website changes, dev for
    source changes)
  • This is either a bugfix, a documentation update, or a new feature that has been explicitly
    approved via an issue
  • I ran the test suite locally (npm run test) and verified that it succeeded

@alexpetros alexpetros added the ready for review Issues that are ready to be considered for merging label Nov 14, 2024
@alexpetros
Copy link
Collaborator

Yup, seems like a good idea.

@1cg 1cg merged commit 704dac7 into bigskysoftware:dev Dec 11, 2024
1 check passed
@1cg
Copy link
Contributor

1cg commented Dec 11, 2024

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready for review Issues that are ready to be considered for merging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants