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
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.
In node 10, fs callbacks are returning an extra undefined value. This violates the current api.
The following code
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 asfs.link
.Sample async code this causes issues with:
In order to mitigate the issue the above code would have to change
to
The text was updated successfully, but these errors were encountered: