Skip to content

Commit

Permalink
Minor API cleanup (nodejs#176)
Browse files Browse the repository at this point in the history
- Make env parameter name consistent in header
 - Remove napi_get_cb_holder; it is not used anywhere. We can add it back later if it's really needed.
  • Loading branch information
jasongin committed Mar 21, 2017
1 parent 1fc1181 commit e1e092f
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 105 deletions.
16 changes: 0 additions & 16 deletions src/node_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1411,22 +1411,6 @@ napi_status napi_get_cb_this(napi_env e,
return napi_ok;
}

// Holder is a V8 concept. Is not clear if this can be emulated with other VMs
// AFAIK Holder should be the owner of the JS function, which should be in the
// prototype chain of This, so maybe it is possible to emulate.
napi_status napi_get_cb_holder(napi_env e,
napi_callback_info cbinfo,
napi_value* result) {
// Omit NAPI_PREAMBLE and GET_RETURN_STATUS because no V8 APIs are called.
CHECK_ARG(result);

v8impl::CallbackWrapper* info =
reinterpret_cast<v8impl::CallbackWrapper*>(cbinfo);

*result = info->Holder();
return napi_ok;
}

napi_status napi_get_cb_data(napi_env e,
napi_callback_info cbinfo,
void** result) {
Expand Down
Loading

0 comments on commit e1e092f

Please sign in to comment.