mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 16:10:02 +01:00
60cc8ff096
In the document for fs, there are several functions that state "No arguments other than a possible exception are given to the completion callback." (ex> fs.access, fs.chmod, fs.close, ..) But, the functions are invoking the callback with two parameters (err, undefined) It causes problems in using several API like [async.waterfall](https://caolan.github.io/async/docs.html#waterfall). PR-URL: https://github.com/nodejs/node/pull/20629 Fixes: https://github.com/nodejs/node/issues/20335 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
13 lines
250 B
JavaScript
13 lines
250 B
JavaScript
'use strict';
|
|
|
|
const common = require('../common');
|
|
|
|
const assert = require('assert');
|
|
const fs = require('fs');
|
|
|
|
const fd = fs.openSync(__filename, 'r');
|
|
|
|
fs.close(fd, common.mustCall(function(...args) {
|
|
assert.deepStrictEqual(args, [null]);
|
|
}));
|