Skip to content

Commit e0b1109

Browse files
committed
fixup! fixup! fixup! fixup! stream: add iterator helper find
1 parent 543f5b3 commit e0b1109

4 files changed

Lines changed: 12 additions & 4 deletions

File tree

test/parallel/test-stream-filter.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,9 @@ const { setTimeout } = require('timers/promises');
100100
}
101101
{
102102
const stream = Readable.from([1, 2, 3, 4, 5]);
103-
stream.map = common.mustNotCall(() => {});
103+
Object.defineProperty(stream, 'map', {
104+
value: common.mustNotCall(() => {}),
105+
});
104106
// Check that map isn't getting called.
105107
stream.filter(() => true);
106108
}

test/parallel/test-stream-flatMap.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,9 @@ function oneTo5() {
123123
}
124124
{
125125
const stream = oneTo5();
126-
stream.map = common.mustNotCall(() => {});
126+
Object.defineProperty(stream, 'map', {
127+
value: common.mustNotCall(() => {}),
128+
});
127129
// Check that map isn't getting called.
128130
stream.flatMap(() => true);
129131
}

test/parallel/test-stream-forEach.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@ const { setTimeout } = require('timers/promises');
8686
}
8787
{
8888
const stream = Readable.from([1, 2, 3, 4, 5]);
89-
stream.map = common.mustNotCall(() => {});
89+
Object.defineProperty(stream, 'map', {
90+
value: common.mustNotCall(() => {}),
91+
});
9092
// Check that map isn't getting called.
9193
stream.forEach(() => true);
9294
}

test/parallel/test-stream-some-find-every.mjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,9 @@ function oneTo5Async() {
165165
{
166166
for (const op of ['some', 'every', 'find']) {
167167
const stream = oneTo5();
168-
stream.map = common.mustNotCall(() => {});
168+
Object.defineProperty(stream, 'map', {
169+
value: common.mustNotCall(() => {}),
170+
});
169171
// Check that map isn't getting called.
170172
stream[op](() => {});
171173
}

0 commit comments

Comments
 (0)