Permalink
Browse files

Close #7 Throw when no callback is provided, and default opts to {}

  • Loading branch information...
isaacs committed Oct 7, 2011
1 parent 0e9b37d commit 4af3afef9bf74c0d61d74ce9879c2579f03343f4
Showing with 3 additions and 0 deletions.
  1. +3 −0 rimraf.js
View
@@ -21,6 +21,9 @@ var timeout = 0
function rimraf (p, opts, cb) {
if (typeof opts === "function") cb = opts, opts = {}
+ if (!cb) throw new Error("No callback passed to rimraf()")
+ if (!opts) opts = {}
+
var busyTries = 0
opts.maxBusyTries = opts.maxBusyTries || 3

0 comments on commit 4af3afe

Please sign in to comment.