Skip to content

Conversation

@CommanderRoot
Copy link
Contributor

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.

.substr() is deprecated so we replace it with .slice() which works similarily but isn't deprecated

Signed-off-by: Tobias Speicher <[email protected]>
Copy link
Member

@Tyriar Tyriar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this is a good change but I'd prefer substring as it feels more natural on strings over slice.

@CommanderRoot
Copy link
Contributor Author

The current codebase has more slice() usage than substring(). Also generally slice() is a bit faster than substring() and about the same as substr(). Slice is also bit shorter which means it the code is smaller.
If you still want to rather use substring() I can change it hower, your repo, your rules.

Copy link
Member

@Tyriar Tyriar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think you've convinced me 🙂 Thanks!

@Tyriar Tyriar added this to the 4.19.0 milestone Mar 28, 2022
@Tyriar Tyriar merged commit 89af5b1 into xtermjs:master Mar 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants