Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
derive the type of the throw handler using decltype
  • Loading branch information
Gabriel Schulhof committed May 26, 2020
commit 7743f469f675d06884fc9134808ca17dcd4bea7e
3 changes: 1 addition & 2 deletions src/js_native_api_v8.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,8 @@ struct napi_env__ {
HandleThrow(napi_env env, v8::Local<v8::Value> value) {
env->isolate->ThrowException(value);
}
typedef void (*ThrowHandler)(napi_env, v8::Local<v8::Value>);

template <typename T, typename U = ThrowHandler>
template <typename T, typename U = decltype(HandleThrow)>
inline void CallIntoModule(T&& call, U&& handle_exception = HandleThrow) {
int open_handle_scopes_before = open_handle_scopes;
int open_callback_scopes_before = open_callback_scopes;
Expand Down