Skip to content

Commit

Permalink
Do not check errors with instanceof (#805)
Browse files Browse the repository at this point in the history
This fixes cross-VM type issues in Jest.

Backport of isaacs/rimraf@aa50e02
  • Loading branch information
federicobozzini committed Jun 3, 2020
1 parent 28173ed commit f86c099
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions lib/remove/rimraf.js
Expand Up @@ -113,9 +113,6 @@ function 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 @@ -139,9 +136,6 @@ function fixWinEPERMSync (p, options, er) {

assert(p)
assert(options)
if (er) {
assert(er instanceof Error)
}

try {
options.chmodSync(p, 0o666)
Expand Down Expand Up @@ -173,9 +167,6 @@ function fixWinEPERMSync (p, options, er) {
function 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 @@ -268,9 +259,6 @@ function rimrafSync (p, options) {
function rmdirSync (p, options, originalEr) {
assert(p)
assert(options)
if (originalEr) {
assert(originalEr instanceof Error)
}

try {
options.rmdirSync(p)
Expand Down

0 comments on commit f86c099

Please sign in to comment.