Fix #1322, length of (int) 0 inputs

I also renamed the internal variables to be slightly more generic, but
now the function reads better. (IMO)
dev
Michael Ball 2016-07-19 02:34:08 -07:00
rodzic 0974c750ad
commit 04b4c6678d
1 zmienionych plików z 5 dodań i 5 usunięć

Wyświetl plik

@ -2411,12 +2411,12 @@ Process.prototype.reportLetter = function (idx, string) {
return str[i - 1] || '';
};
Process.prototype.reportStringSize = function (string) {
if (string instanceof List) { // catch a common user error
return string.length();
Process.prototype.reportStringSize = function (data) {
if (data instanceof List) { // catch a common user error
return data.length();
}
var str = (string || '').toString();
return str.length;
return (isNil(data) ? '' : data).toString().length;
};
Process.prototype.reportUnicode = function (string) {