mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-09-17 02:16:54 +00:00
Replace deprecated String.prototype.substr()
String.prototype.substr() is deprecated (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substr) so we replace it with slice() which works similarily but isn't deprecated. Signed-off-by: Tobias Speicher <rootcommander@gmail.com>
This commit is contained in:
parent
e20ee44015
commit
3f59c9e8b2
2 changed files with 3 additions and 3 deletions
|
@ -376,7 +376,7 @@ function mention_processAll(tokens, msg, user, color_mentions) {
|
|||
this.applyHighlight(msg, priority, null, 'mention', true);
|
||||
|
||||
// Push the remaining text from the token.
|
||||
text.push(segment.substr(match[0].length));
|
||||
text.push(segment.slice(match[0].length));
|
||||
}
|
||||
|
||||
} else
|
||||
|
|
|
@ -438,8 +438,8 @@ export default {
|
|||
if ( idx === -1 )
|
||||
msg.user = null;
|
||||
else {
|
||||
msg.user = msg.prefix.substr(0, idx);
|
||||
msg.prefix = msg.prefix.substr(idx);
|
||||
msg.user = msg.prefix.slice(0, idx);
|
||||
msg.prefix = msg.prefix.slice(idx);
|
||||
}
|
||||
|
||||
return msg;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue