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

Skip to content

Replace calls to deprecated String.substr() #6146

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

Closed
wants to merge 7 commits into from
Closed

Conversation

archmoj
Copy link
Contributor

@archmoj archmoj commented Mar 18, 2022

Addressing #6078.
This is quite tricky whereas several npm packages are also affected.
For now we tried to achieve that by finding & replacing any .substr(a, ?b) with .slice(a, (a)+ b) in all types of bundles.

@plotly/plotly_js
cc: @timeowilliams

@archmoj archmoj added bug something broken type: maintenance labels Mar 18, 2022
@archmoj
Copy link
Contributor Author

archmoj commented Mar 19, 2022

The 'substring' method appears to have some strange behavior. See https://masteringjs.io/tutorials/fundamentals/substring

Perhaps safer to use the slice method instead?

@archmoj archmoj changed the title Replace calls to deprecated String.substr() with .substring() Replace calls to deprecated String.substr() Mar 22, 2022
@gvwilson gvwilson self-assigned this May 27, 2024
@archmoj
Copy link
Contributor Author

archmoj commented Jul 10, 2024

Kind of agree with people questioning that substr() should not be deprecated here.
Closing this PR.

@archmoj archmoj closed this Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants