Skip to content

Commit 1fc30a8

Browse files
mcollinadanielleadams
authored andcommitted
stream,zlib: do not use _stream_* anymore
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]>
1 parent 72b0ab0 commit 1fc30a8

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
@@ -215,7 +215,7 @@ function pipeline(...streams) {
215215
}
216216
} else {
217217
if (!PassThrough) {
218-
PassThrough = require('_stream_passthrough');
218+
PassThrough = require('internal/streams/passthrough');
219219
}
220220

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

lib/zlib.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ const {
5252
},
5353
hideStackFrames
5454
} = require('internal/errors');
55-
const Transform = require('_stream_transform');
55+
const { Transform, finished } = require('stream');
5656
const {
5757
deprecate
5858
} = require('internal/util');
@@ -62,7 +62,6 @@ const {
6262
} = require('internal/util/types');
6363
const binding = internalBinding('zlib');
6464
const assert = require('internal/assert');
65-
const finished = require('internal/streams/end-of-stream');
6665
const {
6766
Buffer,
6867
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)