From 1aba82fa6a8de9d58cb1a98ef6eaa2e892f28821 Mon Sep 17 00:00:00 2001 From: Michael Ball Date: Wed, 12 Jan 2022 15:42:06 -0500 Subject: [PATCH] use `Array.from` to report string length. This is another fix to better support multi-byte emoji --- src/threads.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/threads.js b/src/threads.js index adee886c..22556419 100644 --- a/src/threads.js +++ b/src/threads.js @@ -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) {