Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a5dec3a

Browse filesBrowse files
committed
stream: validate abort signal
PR-URL: #39346 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
1 parent de85b1e commit a5dec3a
Copy full SHA for a5dec3a

File tree

Expand file treeCollapse file tree

2 files changed

+6
-4
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+6
-4
lines changed
Open diff view settings
Collapse file

‎lib/internal/streams/readable.js‎

Copy file name to clipboardExpand all lines: lib/internal/streams/readable.js
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ const { Stream, prependListener } = require('internal/streams/legacy');
4343
const { Buffer } = require('buffer');
4444

4545
const {
46-
addAbortSignalNoValidate,
46+
addAbortSignal,
4747
} = require('internal/streams/add-abort-signal');
4848
const eos = require('internal/streams/end-of-stream');
4949

@@ -199,8 +199,9 @@ function Readable(options) {
199199

200200
if (typeof options.construct === 'function')
201201
this._construct = options.construct;
202+
202203
if (options.signal && !isDuplex)
203-
addAbortSignalNoValidate(options.signal, this);
204+
addAbortSignal(options.signal, this);
204205
}
205206

206207
Stream.call(this, options);
Collapse file

‎lib/internal/streams/writable.js‎

Copy file name to clipboardExpand all lines: lib/internal/streams/writable.js
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const { Buffer } = require('buffer');
4646
const destroyImpl = require('internal/streams/destroy');
4747

4848
const {
49-
addAbortSignalNoValidate,
49+
addAbortSignal,
5050
} = require('internal/streams/add-abort-signal');
5151

5252
const {
@@ -249,8 +249,9 @@ function Writable(options) {
249249

250250
if (typeof options.construct === 'function')
251251
this._construct = options.construct;
252+
252253
if (options.signal)
253-
addAbortSignalNoValidate(options.signal, this);
254+
addAbortSignal(options.signal, this);
254255
}
255256

256257
Stream.call(this, options);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.