fix(zlib): handle no flush flag in handle_.write (#21432)

Fixes https://github.com/denoland/deno/issues/21096
This commit is contained in:
Divy Srivastava 2023-12-13 22:28:56 +05:30 committed by GitHub
parent 10ab8c1ef1
commit 38002ffdd7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 1 deletions

View File

@ -81,3 +81,18 @@ Deno.test(
await promise;
},
);
Deno.test(
"zlib flush i32",
// FIXME: Handle is not closed properly
{ sanitizeResources: false },
function () {
const handle = createDeflate({
// @ts-expect-error: passing non-int flush value
flush: "",
});
handle.end();
handle.destroy();
},
);

View File

@ -120,7 +120,7 @@ class Zlib {
core.opAsync(
"op_zlib_write_async",
this.#handle,
flush,
flush ?? Z_NO_FLUSH,
input,
in_off,
in_len,