mirror of
https://github.com/denoland/deno.git
synced 2025-01-11 08:33:43 -05:00
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:
parent
77a9683425
commit
19c8d7702f
1 changed files with 8 additions and 2 deletions
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue