Skip to content

gunzipSync DOA in Node 14.15.2 #36615

Description

@ledbit

What steps will reproduce the bug?

Any code using gunzipSync will crash

$ cat gunzip.js 
const { gunzipSync } = require('zlib');
console.log(gunzipSync('fooobar'));

$ node -v
v14.15.2

$ node gunzip.js 
internal/streams/readable.js:193
  const isDuplex = this instanceof Stream.Duplex;
                        ^

TypeError: Right-hand side of 'instanceof' is not an object
    at Gunzip.Readable (internal/streams/readable.js:193:25)
    at Gunzip.Duplex (internal/streams/duplex.js:56:12)
    at Gunzip.Transform (internal/streams/transform.js:117:10)
    at Gunzip.ZlibBase (zlib.js:271:13)
    at Gunzip.Zlib (zlib.js:669:12)
    at new Gunzip (zlib.js:732:8)
    at syncBufferWrapper (zlib.js:765:29)
    at Object.<anonymous> (/home/ledion/workspaces/js2bin/gunzip.js:2:13)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)

The regression seems to have been introduced in 14.15.2 and is present in 14.15.3.

Maybe related to #35239? cc @mcollina

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

confirmed-bugIssues and PRs for confirmed bugs.zlibIssues and PRs related to the zlib module and its compression dependencies.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions