Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: do not check errors with instanceof. #805

Merged
merged 1 commit into from
Jun 3, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions lib/remove/rimraf.js
Original file line number Diff line number Diff line change
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