chore: improve error messages in CompressionStream (#13585)

This commit makes the error messages that one sees when passing
something other than a BufferSource to a (De)CompressionStream. The
WPT tests already pass, because they just check for error type
(TypeError), and not error message. A TypeError was already thrown for
invalid values via serde_v8.
This commit is contained in:
Luca Casonato 2022-02-16 12:21:46 +01:00 committed by GitHub
parent 77a9683425
commit 19c8d7702f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -35,7 +35,10 @@
this.#transform = new TransformStream({
transform(chunk, controller) {
// TODO(lucacasonato): convert chunk to BufferSource
chunk = webidl.converters.BufferSource(chunk, {
prefix,
context: "chunk",
});
const output = core.opSync(
"op_compression_write",
rid,
@ -81,7 +84,10 @@
this.#transform = new TransformStream({
transform(chunk, controller) {
// TODO(lucacasonato): convert chunk to BufferSource
chunk = webidl.converters.BufferSource(chunk, {
prefix,
context: "chunk",
});
const output = core.opSync(
"op_compression_write",
rid,