-
-
Notifications
You must be signed in to change notification settings - Fork 34k
src: fix the returned Promise of fs.promises.symlink #18791
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
cjihrig
left a comment
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.
Is there a test that can be added for this?
|
Note that this conflicts with #18777 Also +1 on adding a test |
|
Do you mean a test for |
| if (req_wrap != nullptr) { // symlink(target, path, flags, req) | ||
| AsyncDestCall(env, req_wrap, args, "symlink", *path, path.length(), UTF8, | ||
| AfterNoArgs, uv_fs_symlink, *target, *path, flags); | ||
| req_wrap->SetReturnValue(args); |
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.
It is not safe to call req_wrap->SetReturnValue(args) like this without checking if the pointer returned by AsyncDestCall is nullptr, see #18811 (that PR just calls SetReturnValue () inside AsyncDestCall so the binding do not have to touch req_wrap)
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.
I see, thank you for the information!
Overview
Cf. #18674
I added missing
req_wrap->SetReturnValue(args);in Symlink of node_file.cc.Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)
src, fs