summaryrefslogtreecommitdiff
path: root/ext/web/08_text_encoding.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/web/08_text_encoding.js')
-rw-r--r--ext/web/08_text_encoding.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/ext/web/08_text_encoding.js b/ext/web/08_text_encoding.js
index 9e0c1f311..db724033f 100644
--- a/ext/web/08_text_encoding.js
+++ b/ext/web/08_text_encoding.js
@@ -25,6 +25,7 @@
TypedArrayPrototypeSubarray,
TypedArrayPrototypeSlice,
Uint8Array,
+ Uint32Array,
} = window.__bootstrap.primordials;
class TextDecoder {
@@ -199,10 +200,16 @@
context: "Argument 2",
allowShared: true,
});
- return ops.op_encoding_encode_into(source, destination);
+ ops.op_encoding_encode_into(source, destination, encodeIntoBuf);
+ return {
+ read: encodeIntoBuf[0],
+ written: encodeIntoBuf[1],
+ };
}
}
+ const encodeIntoBuf = new Uint32Array(2);
+
webidl.configurePrototype(TextEncoder);
const TextEncoderPrototype = TextEncoder.prototype;