mirror of
https://github.com/denoland/deno.git
synced 2025-09-26 20:29:11 +00:00
fix(op_crates/web): TextEncoder should throw RangeError (#8039)
This commit changes error type thrown by TextEncoder, when provided encoding is not supported matching Chromium behavior.
This commit is contained in:
parent
1474d5d76d
commit
623ac9e6df
3 changed files with 26 additions and 3 deletions
|
@ -981,7 +981,7 @@
|
|||
);
|
||||
}
|
||||
if (!decoders.has(encoding) && encoding !== "utf-8") {
|
||||
throw new TypeError(`Internal decoder ('${encoding}') not found.`);
|
||||
throw new RangeError(`Internal decoder ('${encoding}') not found.`);
|
||||
}
|
||||
this.#encoding = encoding;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue