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 <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
  • Loading branch information
mcollina authored and aduh95 committed Dec 29, 2020
1 parent 5887ba7 commit e57d8af
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 @@ -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
Original file line number Diff line number Diff line change
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
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 e57d8af

Please sign in to comment.