less / less.js

Less. The dynamic stylesheet language.
http://lesscss.org
Apache License 2.0
17k stars 3.41k forks source link

chore: replace deprecated String.prototype.substr() #3702

Open CommanderRoot opened 2 years ago

CommanderRoot commented 2 years ago

What:

Replacing usage of .substr() with .slice()

Why:

String.prototype.substr() is deprecated.

Checklist:

iChenLei commented 2 years ago

Thanks for your contribution, @matthew-dean sir, what'r you opinion ? Do we need replace substr with slice now? (To be honest, I never use substr on my own code.

matthew-dean commented 2 years ago

Oh interesting, I had no idea it was deprecated. However, I'm wary of this drop-in replace with .slice. The MDN document doesn't say that it's a drop-in replacement, and gives a different polyfill.