summaryrefslogtreecommitdiff
path: root/benchmark
diff options
context:
space:
mode:
authorcjihrig <cjihrig@gmail.com>2014-12-15 13:58:37 -0500
committercjihrig <cjihrig@gmail.com>2014-12-19 10:27:48 -0500
commit56785958565378c9ba43c5bdf5c631f7738f95ab (patch)
treef1620dc26c8c4394e34fa07cdafb7434ac9c30bb /benchmark
parenta5532674b09ebb10bee1bdd3c5c8ff44011a4912 (diff)
downloadnode-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.js4
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
}
}