diff options
author | Weijia Wang <starkwang@126.com> | 2019-03-18 19:31:07 +0800 |
---|---|---|
committer | Weijia Wang <381152119@qq.com> | 2019-03-21 21:38:02 +0800 |
commit | c8d3a73c8b673792e315759b70cf4822b64b3e45 (patch) | |
tree | 39f35c7327e82964acf66f63c3e9d1c919c3382b /lib/_stream_readable.js | |
parent | 1935625df4f56bd77c57ec100a9222c77e9d440c (diff) | |
download | android-node-v8-c8d3a73c8b673792e315759b70cf4822b64b3e45.tar.gz android-node-v8-c8d3a73c8b673792e315759b70cf4822b64b3e45.tar.bz2 android-node-v8-c8d3a73c8b673792e315759b70cf4822b64b3e45.zip |
lib: use Array#includes instead of Array#indexOf
PR-URL: https://github.com/nodejs/node/pull/26732
Refs: https://github.com/nodejs/node/issues/26568
Reviewed-By: Michaƫl Zasso <targos@protonmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Diffstat (limited to 'lib/_stream_readable.js')
-rw-r--r-- | lib/_stream_readable.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/_stream_readable.js b/lib/_stream_readable.js index fe77c44186..ba948c6194 100644 --- a/lib/_stream_readable.js +++ b/lib/_stream_readable.js @@ -713,7 +713,7 @@ Readable.prototype.pipe = function(dest, pipeOpts) { // also returned false. // => Check whether `dest` is still a piping destination. if (((state.pipesCount === 1 && state.pipes === dest) || - (state.pipesCount > 1 && state.pipes.indexOf(dest) !== -1)) && + (state.pipesCount > 1 && state.pipes.includes(dest))) && !cleanedUp) { debug('false write response, pause', state.awaitDrain); state.awaitDrain++; |