Skip to content

Commit f86c099

Browse files
Do not check errors with instanceof (#805)
This fixes cross-VM type issues in Jest. Backport of isaacs/rimraf@aa50e02
1 parent 28173ed commit f86c099

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

lib/remove/rimraf.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,6 @@ function fixWinEPERM (p, options, er, cb) {
113113
assert(p)
114114
assert(options)
115115
assert(typeof cb === 'function')
116-
if (er) {
117-
assert(er instanceof Error)
118-
}
119116

120117
options.chmod(p, 0o666, er2 => {
121118
if (er2) {
@@ -139,9 +136,6 @@ function fixWinEPERMSync (p, options, er) {
139136

140137
assert(p)
141138
assert(options)
142-
if (er) {
143-
assert(er instanceof Error)
144-
}
145139

146140
try {
147141
options.chmodSync(p, 0o666)
@@ -173,9 +167,6 @@ function fixWinEPERMSync (p, options, er) {
173167
function rmdir (p, options, originalEr, cb) {
174168
assert(p)
175169
assert(options)
176-
if (originalEr) {
177-
assert(originalEr instanceof Error)
178-
}
179170
assert(typeof cb === 'function')
180171

181172
// try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS)
@@ -268,9 +259,6 @@ function rimrafSync (p, options) {
268259
function rmdirSync (p, options, originalEr) {
269260
assert(p)
270261
assert(options)
271-
if (originalEr) {
272-
assert(originalEr instanceof Error)
273-
}
274262

275263
try {
276264
options.rmdirSync(p)

0 commit comments

Comments
 (0)