From 623ac9e6df660b758aa3da281b6ff2b4db265ef0 Mon Sep 17 00:00:00 2001 From: Leonard Ginters Date: Mon, 19 Oct 2020 23:56:29 +0200 Subject: 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. --- op_crates/web/08_text_encoding.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (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 f55646e12..5a84ea8a4 100644 --- a/op_crates/web/08_text_encoding.js +++ b/op_crates/web/08_text_encoding.js @@ -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; } -- cgit v1.2.3