mirror of
https://github.com/denoland/deno.git
synced 2025-03-03 17:34:47 -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({
|
this.#transform = new TransformStream({
|
||||||
transform(chunk, controller) {
|
transform(chunk, controller) {
|
||||||
// TODO(lucacasonato): convert chunk to BufferSource
|
chunk = webidl.converters.BufferSource(chunk, {
|
||||||
|
prefix,
|
||||||
|
context: "chunk",
|
||||||
|
});
|
||||||
const output = core.opSync(
|
const output = core.opSync(
|
||||||
"op_compression_write",
|
"op_compression_write",
|
||||||
rid,
|
rid,
|
||||||
|
@ -81,7 +84,10 @@
|
||||||
|
|
||||||
this.#transform = new TransformStream({
|
this.#transform = new TransformStream({
|
||||||
transform(chunk, controller) {
|
transform(chunk, controller) {
|
||||||
// TODO(lucacasonato): convert chunk to BufferSource
|
chunk = webidl.converters.BufferSource(chunk, {
|
||||||
|
prefix,
|
||||||
|
context: "chunk",
|
||||||
|
});
|
||||||
const output = core.opSync(
|
const output = core.opSync(
|
||||||
"op_compression_write",
|
"op_compression_write",
|
||||||
rid,
|
rid,
|
||||||
|
|
Loading…
Add table
Reference in a new issue