Skip to content

Commit 98f6155

Browse files
mcollinaBethGriggs
authored andcommitted
stream,zlib: do not use _stream_* anymore
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>
1 parent 5593187 commit 98f6155

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

lib/internal/streams/pipeline.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ function pipeline(...streams) {
213213
}
214214
} else {
215215
if (!PassThrough) {
216-
PassThrough = require('_stream_passthrough');
216+
PassThrough = require('internal/streams/passthrough');
217217
}
218218

219219
// If the last argument to pipeline is not a stream

lib/zlib.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ const {
4747
},
4848
hideStackFrames
4949
} = require('internal/errors');
50-
const Transform = require('_stream_transform');
50+
const { Transform, finished } = require('stream');
5151
const {
5252
deprecate
5353
} = require('internal/util');
@@ -57,7 +57,6 @@ const {
5757
} = require('internal/util/types');
5858
const binding = internalBinding('zlib');
5959
const assert = require('internal/assert');
60-
const finished = require('internal/streams/end-of-stream');
6160
const {
6261
Buffer,
6362
kMaxLength

test/parallel/test-zlib-no-stream.js

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/* eslint-disable node-core/required-modules */
2+
/* eslint-disable node-core/require-common-first */
3+
4+
'use strict';
5+
6+
// We are not loading common because it will load the stream module,
7+
// defeating the purpose of this test.
8+
9+
const { gzipSync } = require('zlib');
10+
11+
// Avoid regressions such as https://github.com/nodejs/node/issues/36615
12+
13+
// This must not throw
14+
gzipSync('fooobar');

0 commit comments

Comments
 (0)