Skip to content

Commit

Permalink
Avoid setPrototypeOf if prototype is undefined
Browse files Browse the repository at this point in the history
Fix: #222
PR-URL: #230
Credit: @yoshixi
Close: #230
Reviewed-by: @isaacs
  • Loading branch information
yoshixi authored and isaacs committed Apr 1, 2022
1 parent fe43e51 commit 393b623
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion polyfills.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ function patch (fs) {
}

// This ensures `util.promisify` works as it does for native `fs.read`.
if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read)
if (Object.setPrototypeOf && fs$read != undefined) Object.setPrototypeOf(read, fs$read)
return read
})(fs.read)

Expand Down

0 comments on commit 393b623

Please sign in to comment.