summaryrefslogtreecommitdiff
path: root/op_crates/web/08_text_encoding.js
diff options
context:
space:
mode:
authorLeonard Ginters <leonard@linters.de>2020-10-19 23:56:29 +0200
committerGitHub <noreply@github.com>2020-10-19 23:56:29 +0200
commit623ac9e6df660b758aa3da281b6ff2b4db265ef0 (patch)
tree09749c4a1189d5b1a9edd95e5cf42d7248e2d2dc /op_crates/web/08_text_encoding.js
parent1474d5d76d38c094c6c551bcd23a61f8328bb258 (diff)
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.
Diffstat (limited to 'op_crates/web/08_text_encoding.js')
-rw-r--r--op_crates/web/08_text_encoding.js2
1 files changed, 1 insertions, 1 deletions
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;
}