Skip to content

Commit 32916e9

Browse files
mcollinaaduh95
andauthored
Apply suggestions from code review
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
1 parent f6b3adb commit 32916e9

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

lib/internal/streams/duplexify.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ function fromAsyncGen(fn) {
247247
if (resolve !== null) {
248248
const _resolve = resolve;
249249
resolve = null;
250-
_resolve({ done: true, cb() {} });
250+
_resolve({ __proto__: null, done: true, cb() {} });
251251
}
252252

253253
cb(err);

test/parallel/test-stream-readable-compose.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,13 +121,12 @@ const assert = require('assert');
121121
const stream = Readable.from(['hello'])
122122
.compose(async function *(source) {
123123
for await (const chunk of source) {
124+
yield chunk;
124125
throw new Error(`boom: ${chunk}`);
125126
}
126127
})
127128
.compose(async function *(source) {
128-
for await (const chunk of source) {
129-
yield chunk;
130-
}
129+
yield* source;
131130
});
132131

133132
assert.rejects(

0 commit comments

Comments
 (0)