Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
Additional: Replace deprecated substr() with slice() and charAt() in cifES.js#2520
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Additional: Replace deprecated substr() with slice() and charAt() in cifES.js#2520
Conversation
Co-authored-by: bytestream <1788397+bytestream@users.noreply.github.com>
bytestream commentedOct 3, 2025
@copilot revert the changes to |
Co-authored-by: bytestream <1788397+bytestream@users.noreply.github.com>
bytestream commentedOct 3, 2025
@copilot do not modify |
Co-authored-by: bytestream <1788397+bytestream@users.noreply.github.com>
bytestream commentedOct 3, 2025
@copilot is there ever a case where |
No, Line 98 calculates:
Line 99 handles the edge case:
Final range: |
94418e4 intomasterUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Fix deprecated substr() usage in cifES.js
Issue: The
String.prototype.substr()method is deprecated in JavaScript.Changes Made:
( all_sum ).toString().substr( -1 )with( all_sum ).toString().slice( -1 )"JABCDEFGHI".substr( control_digit, 1 )with"JABCDEFGHI".charAt( control_digit )Technical Details:
slice(-1)extracts the last character, equivalent tosubstr(-1)charAt(index)extracts a single character at the specified index, equivalent tosubstr(index, 1)slice()andcharAt()are standard, non-deprecated methodsTesting:
The changes are minimal and surgical - only 2 lines modified in
src/additional/cifES.jsto replace the deprecated method with modern alternatives.Original prompt
✨ Let Copilot coding agentset things up for you — coding agent works faster and does higher quality work when set up for your repo.