use `Array.from` to report string length.

This is another fix to better support multi-byte emoji
snap7
Michael Ball 2022-01-12 15:42:06 -05:00
rodzic 2bea88c7b0
commit 1aba82fa6a
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -4344,7 +4344,7 @@ Process.prototype.reportStringSize = function (data) {
if (data instanceof List) { // catch a common user error
return data.length();
}
return isNil(data) ? 0 : data.toString().length;
return isNil(data) ? 0 : Array.from(data.toString()).length;
};
Process.prototype.reportUnicode = function (string) {