summaryrefslogtreecommitdiff
path: root/extensions/web/08_text_encoding.js
diff options
context:
space:
mode:
Diffstat (limited to 'extensions/web/08_text_encoding.js')
-rw-r--r--extensions/web/08_text_encoding.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/extensions/web/08_text_encoding.js b/extensions/web/08_text_encoding.js
index 0ba1bb582..0918cee64 100644
--- a/extensions/web/08_text_encoding.js
+++ b/extensions/web/08_text_encoding.js
@@ -141,7 +141,9 @@
encode(input = "") {
webidl.assertBranded(this, TextEncoder);
const prefix = "Failed to execute 'encode' on 'TextEncoder'";
- input = webidl.converters.USVString(input, {
+ // The WebIDL type of `input` is `USVString`, but `core.encode` already
+ // converts lone surrogates to the replacement character.
+ input = webidl.converters.DOMString(input, {
prefix,
context: "Argument 1",
});
@@ -156,7 +158,9 @@
encodeInto(source, destination) {
webidl.assertBranded(this, TextEncoder);
const prefix = "Failed to execute 'encodeInto' on 'TextEncoder'";
- source = webidl.converters.USVString(source, {
+ // The WebIDL type of `source` is `USVString`, but the ops bindings
+ // already convert lone surrogates to the replacement character.
+ source = webidl.converters.DOMString(source, {
prefix,
context: "Argument 1",
});