Skip to content

Commit

Permalink
fixup! lib: add lint rule to protect against Object.prototype.then
Browse files Browse the repository at this point in the history
…pollution
  • Loading branch information
aduh95 committed Oct 19, 2022
1 parent fe474c0 commit feb4e23
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/internal/webstreams/readablestream.js
Expand Up @@ -476,7 +476,7 @@ class ReadableStream {

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

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

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

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

0 comments on commit feb4e23

Please sign in to comment.