You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fs methods returning an additional, undefined value in callback #20872
will output: [Arguments] { '0': null, '1': undefined }
The expected output should be [Arguments] { '0': null }, which it is in node 8.
This creates problems for libraries such as async that expect the signature of fs to only return the error in the callback. fs.unlink is listed above but I have seen the behavior in other methods, such as fs.link.
Sample async code this causes issues with:
constwaterfall=require('async/waterfall')waterfall([(callback)=>fs.unlink('/tmp/existing-file.txt',callback),(callback)=>{
...
// Callback is undefined here because "undefined" is being passed into the `unlink` callback along with a null errorcallback()}])
In order to mitigate the issue the above code would have to change
This appears fixed on the current master branch, so it might be something that is also fixed in the next Node.js release. I'll see if I can figure out what commit changed the behavior back to the expected behavior and then see if it is slated for the next release or not. Uh, unless someone else beats me to it.
Activity
Trott commentedon May 21, 2018
This appears fixed on the current master branch, so it might be something that is also fixed in the next Node.js release. I'll see if I can figure out what commit changed the behavior back to the expected behavior and then see if it is slated for the next release or not. Uh, unless someone else beats me to it.
richardlau commentedon May 22, 2018
Duplicate of #20335 fixed by #20629.
Trott commentedon May 22, 2018
The fix for this issue is likely to be included in 10.2.0 but if not that release, then certainly the next release after that.