mirror of
https://github.com/denoland/deno.git
synced 2025-09-26 20:29:11 +00:00
fix(op_crates/web): make TextEncoder work with forced non-strings (#8206)
Fixes: #8201
This commit is contained in:
parent
d9b8778c45
commit
9397cf508e
2 changed files with 15 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue