summaryrefslogtreecommitdiff
path: root/lib/internal/streams/async_iterator.js
diff options
context:
space:
mode:
authorMatteo Collina <hello@matteocollina.com>2018-10-26 12:24:16 +0200
committerMichaƫl Zasso <targos@protonmail.com>2018-10-28 15:01:58 +0100
commit398418dd2619a2853b4a8b252db90fdf4cb60f7c (patch)
tree8824cd6b592180f552b0a17df73c2b88f32e3a91 /lib/internal/streams/async_iterator.js
parent124d91667abb203098baa7d6cf6011e8df5eeeff (diff)
downloadandroid-node-v8-398418dd2619a2853b4a8b252db90fdf4cb60f7c.tar.gz
android-node-v8-398418dd2619a2853b4a8b252db90fdf4cb60f7c.tar.bz2
android-node-v8-398418dd2619a2853b4a8b252db90fdf4cb60f7c.zip
stream: ended streams should resolve the async iteration
Fixes: https://github.com/nodejs/node/issues/23891 PR-URL: https://github.com/nodejs/node/pull/23901 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'lib/internal/streams/async_iterator.js')
-rw-r--r--lib/internal/streams/async_iterator.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/internal/streams/async_iterator.js b/lib/internal/streams/async_iterator.js
index 25b393d21f..5d7f3f0fb4 100644
--- a/lib/internal/streams/async_iterator.js
+++ b/lib/internal/streams/async_iterator.js
@@ -127,7 +127,10 @@ const createReadableStreamAsyncIterator = (stream) => {
[kLastResolve]: { value: null, writable: true },
[kLastReject]: { value: null, writable: true },
[kError]: { value: null, writable: true },
- [kEnded]: { value: false, writable: true },
+ [kEnded]: {
+ value: stream._readableState.endEmitted,
+ writable: true
+ },
[kLastPromise]: { value: null, writable: true },
// the function passed to new Promise
// is cached so we avoid allocating a new