Skip to content

Commit

Permalink
fix: do not check errors with instanceof.
Browse files Browse the repository at this point in the history
This should avoid the cross-VM type issues we see in Jest.

Fixes #208

PR-URL: #209
Credit: @aslushnikov
Close: #209
Reviewed-by: @isaacs
  • Loading branch information
aslushnikov authored and isaacs committed Feb 9, 2020
1 parent d709272 commit aa50e02
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions rimraf.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,6 @@ const fixWinEPERM = (p, options, er, cb) => {
assert(p)
assert(options)
assert(typeof cb === 'function')
if (er)
assert(er instanceof Error)

options.chmod(p, 0o666, er2 => {
if (er2)
Expand All @@ -185,8 +183,6 @@ const fixWinEPERM = (p, options, er, cb) => {
const fixWinEPERMSync = (p, options, er) => {
assert(p)
assert(options)
if (er)
assert(er instanceof Error)

try {
options.chmodSync(p, 0o666)
Expand Down Expand Up @@ -216,8 +212,6 @@ const fixWinEPERMSync = (p, options, er) => {
const rmdir = (p, options, originalEr, cb) => {
assert(p)
assert(options)
if (originalEr)
assert(originalEr instanceof Error)
assert(typeof cb === 'function')

// try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS)
Expand Down Expand Up @@ -323,8 +317,6 @@ const rimrafSync = (p, options) => {
const rmdirSync = (p, options, originalEr) => {
assert(p)
assert(options)
if (originalEr)
assert(originalEr instanceof Error)

try {
options.rmdirSync(p)
Expand Down

0 comments on commit aa50e02

Please sign in to comment.