GeezerVison is showing github.com — stream: validate abort signal · nodejs/node@a5dec3a
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: lib/internal/streams/readable.js +3-2Lines changed: 3 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -43,7 +43,7 @@ const { Stream, prependListener } = require('internal/streams/legacy'); |
43 | 43 | const { Buffer } = require('buffer'); |
44 | 44 |
|
45 | 45 | const { |
46 | | - addAbortSignalNoValidate, |
| 46 | + addAbortSignal, |
47 | 47 | } = require('internal/streams/add-abort-signal'); |
48 | 48 | const eos = require('internal/streams/end-of-stream'); |
49 | 49 |
|
@@ -199,8 +199,9 @@ function Readable(options) { |
199 | 199 |
|
200 | 200 | if (typeof options.construct === 'function') |
201 | 201 | this._construct = options.construct; |
| 202 | + |
202 | 203 | if (options.signal && !isDuplex) |
203 | | - addAbortSignalNoValidate(options.signal, this); |
| 204 | + addAbortSignal(options.signal, this); |
204 | 205 | } |
205 | 206 |
|
206 | 207 | Stream.call(this, options); |
|
Collapse file
Copy file name to clipboardExpand all lines: lib/internal/streams/writable.js +3-2Lines changed: 3 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -46,7 +46,7 @@ const { Buffer } = require('buffer'); |
46 | 46 | const destroyImpl = require('internal/streams/destroy'); |
47 | 47 |
|
48 | 48 | const { |
49 | | - addAbortSignalNoValidate, |
| 49 | + addAbortSignal, |
50 | 50 | } = require('internal/streams/add-abort-signal'); |
51 | 51 |
|
52 | 52 | const { |
@@ -249,8 +249,9 @@ function Writable(options) { |
249 | 249 |
|
250 | 250 | if (typeof options.construct === 'function') |
251 | 251 | this._construct = options.construct; |
| 252 | + |
252 | 253 | if (options.signal) |
253 | | - addAbortSignalNoValidate(options.signal, this); |
| 254 | + addAbortSignal(options.signal, this); |
254 | 255 | } |
255 | 256 |
|
256 | 257 | Stream.call(this, options); |
|