Skip to content

N-api (node-addon-api) #161

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

Merged
merged 60 commits into from
Apr 3, 2020
Merged

N-api (node-addon-api) #161

merged 60 commits into from
Apr 3, 2020

Conversation

artemp
Copy link
Contributor

@artemp artemp commented Apr 2, 2020

  • Port from Nan to N-API via node-addon-api
  • Use std::vector<char> to hold results of a cpu-intensive-task to avoid const_cast (c++)
  • Add AsyncHelloWorker_v2 using GetResult to pass results of an async op (impl style)
  • Add gsl::owner utility to express explicit transfer of a ownership (c++)
  • Add node v10/12/13 targets (remove node v6/8)

```
../src/object_async/hello_async.cpp:137:1: error: 'object_async::HelloObjectAsync::name_' should be initialized in the member initialization list [-Werror=effc++]
 HelloObjectAsync::HelloObjectAsync(Napi::CallbackInfo const& info)
```

changes. Lines starting
artemp and others added 21 commits March 31, 2020 16:36
…explicitely transfer ownership to keep clang-tidy happy (cppcoreguidelines-owning-memory)
This reverts commit eaa4fbf.
… (e.g clang++ differs from GCC) + check `result_` before deref etc.

C++ standard 5.2.2.8 :
"The order of evaluation of arguments is unspecified. All side effects of argument expression evaluations take effect before the function is entered. The order of evaluation of the postfix expression and the argument expression list is unspecified."

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1905.pdf
@artemp artemp requested a review from springmeyer April 2, 2020 17:42
@springmeyer springmeyer merged commit d3250a9 into master Apr 3, 2020
@springmeyer springmeyer deleted the n-api branch April 3, 2020 20:17
This was referenced Apr 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants