Skip to content
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

fs: migrate ASYNC_CALL to AsyncCall #18144

Closed
wants to merge 2 commits into from

Conversation

joyeecheung
Copy link
Member

This patch migrates all the ASYNC_CALL macro in node_file.cc to the template counterpart AsyncCall. Also goes with a different style of wrapping the arguments so it's clearer to see what arguments are passed to which uv_fs_* functions.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)

fs

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. fs Issues and PRs related to the fs subsystem / file system. labels Jan 14, 2018
@joyeecheung
Copy link
Member Author

@@ -1030,26 +1031,6 @@ static void WriteString(const FunctionCallbackInfo<Value>& args) {
SYNC_CALL(write, nullptr, fd, &uvbuf, 1, pos)
return args.GetReturnValue().Set(SYNC_RESULT);
}

FSReqWrap* req_wrap =
FSReqWrap::New(env, req.As<Object>(), "write", buf, UTF8, ownership);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just noticed that the ownership is lost below. I've fixed it locally but when writing a test for it it seems that fs.write does not work on external two-byte strings on master.

@joyeecheung
Copy link
Member Author

@joyeecheung
Copy link
Member Author

There were some infra issues on linux one. Just in case, a new CI: https://ci.nodejs.org/job/node-test-pull-request/12540/

@joyeecheung joyeecheung added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jan 15, 2018
@joyeecheung
Copy link
Member Author

Landed in eca73a2, thanks!

joyeecheung added a commit that referenced this pull request Jan 16, 2018
This patch migrates all the `ASYNC_CALL` macro in `node_file.cc` to
the template counterpart AsyncCall. Also goes with a different style
of wrapping the arguments so it's clearer to see what arguments are
passed to which `uv_fs_*` functions.

PR-URL: #18144
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
@joyeecheung joyeecheung added dont-land-on-v4.x and removed author ready PRs that have at least one approval, no pending requests for changes, and a CI started. labels Jan 16, 2018
@joyeecheung joyeecheung mentioned this pull request Jan 18, 2018
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Issues and PRs that require attention from people who are familiar with C++. fs Issues and PRs related to the fs subsystem / file system.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants