From 9397cf508e57b8dac7d68b5469c1cca0618c6b10 Mon Sep 17 00:00:00 2001 From: Benjamin Gruenbaum Date: Mon, 2 Nov 2020 01:57:18 +0200 Subject: fix(op_crates/web): make TextEncoder work with forced non-strings (#8206) Fixes: #8201 --- op_crates/web/08_text_encoding.js | 1 + 1 file changed, 1 insertion(+) (limited to 'op_crates/web/08_text_encoding.js') diff --git a/op_crates/web/08_text_encoding.js b/op_crates/web/08_text_encoding.js index d93319758..13e256982 100644 --- a/op_crates/web/08_text_encoding.js +++ b/op_crates/web/08_text_encoding.js @@ -1061,6 +1061,7 @@ class TextEncoder { encoding = "utf-8"; encode(input = "") { + input = String(input); // Deno.core.encode() provides very efficient utf-8 encoding if (this.encoding === "utf-8") { return core.encode(input); -- cgit v1.2.3