diff options
author | cjihrig <cjihrig@gmail.com> | 2014-12-15 13:58:37 -0500 |
---|---|---|
committer | cjihrig <cjihrig@gmail.com> | 2014-12-19 10:27:48 -0500 |
commit | 56785958565378c9ba43c5bdf5c631f7738f95ab (patch) | |
tree | f1620dc26c8c4394e34fa07cdafb7434ac9c30bb /benchmark | |
parent | a5532674b09ebb10bee1bdd3c5c8ff44011a4912 (diff) | |
download | node-new-56785958565378c9ba43c5bdf5c631f7738f95ab.tar.gz |
fs: deprecate exists() and existsSync()
These methods don't follow standard conventions, and shouldn't
be used anyway.
Fixes: https://github.com/iojs/io.js/issues/103
PR-URL: https://github.com/iojs/io.js/pull/166
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'benchmark')
-rw-r--r-- | benchmark/misc/module-loader.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/benchmark/misc/module-loader.js b/benchmark/misc/module-loader.js index 96f8e7df1e..00a9369650 100644 --- a/benchmark/misc/module-loader.js +++ b/benchmark/misc/module-loader.js @@ -56,7 +56,7 @@ function measure(n) { } function rmrf(location) { - if (fs.existsSync(location)) { + try { var things = fs.readdirSync(location); things.forEach(function(thing) { var cur = path.join(location, thing), @@ -68,5 +68,7 @@ function rmrf(location) { fs.unlinkSync(cur); }); fs.rmdirSync(location); + } catch (err) { + // Ignore error } } |