make chr_repeat more defensive for invalid parameters

This commit is contained in:
copy 2014-02-23 23:06:22 +01:00
parent 13420f31ce
commit f9dd551448

View file

@ -210,7 +210,7 @@ String.chr_repeat = function(chr, count)
{
var result = "";
while(count--)
while(count-- > 0)
{
result += chr;
}