summaryrefslogtreecommitdiff
path: root/test/parallel/test-fs-mkdtemp.js
diff options
context:
space:
mode:
authorSakthipriyan Vairamani <thechargingvolcano@gmail.com>2016-05-18 17:22:17 +0530
committerJames M Snell <jasnell@gmail.com>2016-05-20 08:28:16 -0700
commitdcbf246b3512fd057a7799b0e0268efdc6798d49 (patch)
treebfc1c7939d456f9cd16015c19ea117c4884f54af /test/parallel/test-fs-mkdtemp.js
parent2ef83590ce59e5525a7aa784439fd28428b23d9a (diff)
downloadandroid-node-v8-dcbf246b3512fd057a7799b0e0268efdc6798d49.tar.gz
android-node-v8-dcbf246b3512fd057a7799b0e0268efdc6798d49.tar.bz2
android-node-v8-dcbf246b3512fd057a7799b0e0268efdc6798d49.zip
fs: mkdtemp shouldn't crash if no callback passed
As it is, `fs.mkdtemp` crashes with a C++ assertion if the callback function is not passed. This patch uses `maybeCallback` to create one, if no callback function is passed. PR-URL: https://github.com/nodejs/node/pull/6828 Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'test/parallel/test-fs-mkdtemp.js')
-rw-r--r--test/parallel/test-fs-mkdtemp.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/test/parallel/test-fs-mkdtemp.js b/test/parallel/test-fs-mkdtemp.js
index ad8a6cb46e..d3def97fef 100644
--- a/test/parallel/test-fs-mkdtemp.js
+++ b/test/parallel/test-fs-mkdtemp.js
@@ -25,3 +25,5 @@ fs.mkdtemp(
assert(common.fileExists(folder));
})
);
+
+assert.doesNotThrow(() => fs.mkdtemp(path.join(common.tmpDir, 'bar-')));