Skip to content

Commit feb4e23

Browse files
committed
fixup! lib: add lint rule to protect against Object.prototype.then pollution
1 parent fe474c0 commit feb4e23

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/internal/webstreams/readablestream.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ class ReadableStream {
476476

477477
async function returnSteps(value) {
478478
if (done)
479-
return { done: true, value }; // eslint-disable-line node-core/avoid-prototype-pollution
479+
return { __proto__: null, done: true, value };
480480
done = true;
481481

482482
if (reader[kState].stream === undefined) {
@@ -488,11 +488,11 @@ class ReadableStream {
488488
const result = readableStreamReaderGenericCancel(reader, value);
489489
readableStreamReaderGenericRelease(reader);
490490
await result;
491-
return { done: true, value }; // eslint-disable-line node-core/avoid-prototype-pollution
491+
return { __proto__: null, done: true, value };
492492
}
493493

494494
readableStreamReaderGenericRelease(reader);
495-
return { done: true, value }; // eslint-disable-line node-core/avoid-prototype-pollution
495+
return { __proto__: null, done: true, value };
496496
}
497497

498498
// TODO(@jasnell): Explore whether an async generator

0 commit comments

Comments
 (0)