Skip to content

Commit

Permalink
stream,zlib: do not use _stream_* anymore
Browse files Browse the repository at this point in the history
PR-URL: #36618
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
  • Loading branch information
mcollina authored and BethGriggs committed Jan 26, 2021
1 parent 5593187 commit 98f6155
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/internal/streams/pipeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,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
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const {
},
hideStackFrames
} = require('internal/errors');
const Transform = require('_stream_transform');
const { Transform, finished } = require('stream');
const {
deprecate
} = require('internal/util');
Expand All @@ -57,7 +57,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
Original file line number Diff line number Diff line change
@@ -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');

0 comments on commit 98f6155

Please sign in to comment.