Skip to content

Commit

Permalink
fs: avoid prototype pollution
Browse files Browse the repository at this point in the history
  • Loading branch information
anonrig committed Oct 22, 2022
1 parent 516d97d commit df1c187
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/internal/fs/watch/linux.js
Expand Up @@ -185,7 +185,7 @@ class FSWatcher extends EventEmitter {

async next() {
if (this.#closed) {
return { done: true };
return { __proto__: null, done: true };
}

const result = await new Promise((resolve) => {
Expand All @@ -194,7 +194,7 @@ class FSWatcher extends EventEmitter {
});
});

return { done: false, value: result };
return { __proto__: null, done: false, value: result };
}

// eslint-disable-next-line require-yield
Expand Down

0 comments on commit df1c187

Please sign in to comment.