-
-
Notifications
You must be signed in to change notification settings - Fork 31.4k
src: remove 2nd undefined
argument in node_file.cc
#20629
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
src/node_file.cc
Outdated
MakeCallback(env()->oncomplete_string(), arraysize(argv), argv); | ||
int len = arraysize(argv); | ||
MakeCallback(env()->oncomplete_string(), | ||
len == 2 && value->IsUndefined() ? 1 : len, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't the length check here redundant as it will always be 2? Why not just check the undefined
-ness?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, right. I fixed.
I thought somebody can modify the function to multiple arguments, but too much worry.
The newly added test seems to be causing a hard crash. |
It seems sequential/test-fs-close-cb-parameters.js is the one crashing now. |
@mscdex I modified the test cases.
|
Tests failed in several linux versions. |
I set an ubuntu1710-x64 system on AWS that had failed in the CI node-test-commit-linux. Also, I tested it on debian9-64 on AWS, it was successful.
Could you please tell me what I should do more in this case? |
I think those are just unrelated, flaky failures. |
I rebased master branch and tested on 3 different linux systems. |
In this time, the CI run failed at fetching git repo step in osx. |
3835724
to
7b958c3
Compare
I rebased master and merged my commits.
Can anybody run a CI test? |
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). Fixes: nodejs#20335
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: nodejs#20629 Fixes: nodejs#20335 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
Thanks a lot! 👍 |
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: #20629 Fixes: #20335 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
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.
Fixes: #20335
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes