Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stream,zlib: do not use _stream_* anymore. #36618

Merged
merged 1 commit into from Dec 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/internal/streams/pipeline.js
Expand Up @@ -215,7 +215,7 @@ function pipeline(...streams) {
}
} else {
if (!PassThrough) {
PassThrough = require('_stream_passthrough');
PassThrough = require('internal/streams/passthrough');
}

// If the last argument to pipeline is not a stream
Expand Down
3 changes: 1 addition & 2 deletions lib/zlib.js
Expand Up @@ -52,7 +52,7 @@ const {
},
hideStackFrames
} = require('internal/errors');
const Transform = require('_stream_transform');
const { Transform, finished } = require('stream');
const {
deprecate
} = require('internal/util');
Expand All @@ -62,7 +62,6 @@ const {
} = require('internal/util/types');
const binding = internalBinding('zlib');
const assert = require('internal/assert');
const finished = require('internal/streams/end-of-stream');
const {
Buffer,
kMaxLength
Expand Down
14 changes: 14 additions & 0 deletions test/parallel/test-zlib-no-stream.js
@@ -0,0 +1,14 @@
/* eslint-disable node-core/required-modules */
/* eslint-disable node-core/require-common-first */

'use strict';

// We are not loading common because it will load the stream module,
// defeating the purpose of this test.

const { gzipSync } = require('zlib');

// Avoid regressions such as https://github.com/nodejs/node/issues/36615

// This must not throw
gzipSync('fooobar');