Skip to content

Commit aa50e02

Browse files
aslushnikovisaacs
authored andcommitted
fix: do not check errors with instanceof.
This should avoid the cross-VM type issues we see in Jest. Fixes #208 PR-URL: #209 Credit: @aslushnikov Close: #209 Reviewed-by: @isaacs
1 parent d709272 commit aa50e02

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

rimraf.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,6 @@ const fixWinEPERM = (p, options, er, cb) => {
164164
assert(p)
165165
assert(options)
166166
assert(typeof cb === 'function')
167-
if (er)
168-
assert(er instanceof Error)
169167

170168
options.chmod(p, 0o666, er2 => {
171169
if (er2)
@@ -185,8 +183,6 @@ const fixWinEPERM = (p, options, er, cb) => {
185183
const fixWinEPERMSync = (p, options, er) => {
186184
assert(p)
187185
assert(options)
188-
if (er)
189-
assert(er instanceof Error)
190186

191187
try {
192188
options.chmodSync(p, 0o666)
@@ -216,8 +212,6 @@ const fixWinEPERMSync = (p, options, er) => {
216212
const rmdir = (p, options, originalEr, cb) => {
217213
assert(p)
218214
assert(options)
219-
if (originalEr)
220-
assert(originalEr instanceof Error)
221215
assert(typeof cb === 'function')
222216

223217
// try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS)
@@ -323,8 +317,6 @@ const rimrafSync = (p, options) => {
323317
const rmdirSync = (p, options, originalEr) => {
324318
assert(p)
325319
assert(options)
326-
if (originalEr)
327-
assert(originalEr instanceof Error)
328320

329321
try {
330322
options.rmdirSync(p)

0 commit comments

Comments
 (0)