From 9359de9dd2eae06ed5afcb75dad9bd4c466eb69d Mon Sep 17 00:00:00 2001 From: Sakthipriyan Vairamani Date: Sun, 26 Jun 2016 12:04:31 +0530 Subject: fs: make callback mandatory to all async functions The "fs" module has two functions called `maybeCallback` and `makeCallback`, as of now. The `maybeCallback` creates a default function to report errors, if the parameter passed is not a function object. Basically, if the callback is omitted in some cases, this function is used to create a default callback function. The `makeCallback`, OTOH, creates a default function only if the parameter passed is `undefined`, and if it is not a function object it will throw an `Error`. This patch removes the `maybeCallback` function and makes the callback function argument mandatory for all the async functions. PR-URL: https://github.com/nodejs/node/pull/7168 Reviewed-By: Trevor Norris --- test/parallel/test-fs-chmod.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/parallel/test-fs-chmod.js') diff --git a/test/parallel/test-fs-chmod.js b/test/parallel/test-fs-chmod.js index 954916cbdb..1564734ec6 100644 --- a/test/parallel/test-fs-chmod.js +++ b/test/parallel/test-fs-chmod.js @@ -101,7 +101,7 @@ fs.open(file2, 'a', function(err, fd) { assert.equal(mode_sync, fs.fstatSync(fd).mode & 0o777); } success_count++; - fs.close(fd); + fs.closeSync(fd); } }); }); -- cgit v1.2.3