Skip to content

Commit

Permalink
src: remove extra semicolons after macros
Browse files Browse the repository at this point in the history
PR-URL: #27579
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Franziska Hinkelmann <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Сковорода Никита Андреевич <[email protected]>
Reviewed-By: Yongsheng Zhang <[email protected]>
  • Loading branch information
gengjiawen authored and targos committed May 13, 2019
1 parent 8cba1af commit 3c70797
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/async_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -294,12 +294,15 @@ static void SetupHooks(const FunctionCallbackInfo<Value>& args) {

Local<Object> fn_obj = args[0].As<Object>();

#define SET_HOOK_FN(name) \
Local<Value> name##_v = fn_obj->Get( \
env->context(), \
FIXED_ONE_BYTE_STRING(env->isolate(), #name)).ToLocalChecked(); \
CHECK(name##_v->IsFunction()); \
env->set_async_hooks_##name##_function(name##_v.As<Function>());
#define SET_HOOK_FN(name) \
do { \
Local<Value> v = \
fn_obj->Get(env->context(), \
FIXED_ONE_BYTE_STRING(env->isolate(), #name)) \
.ToLocalChecked(); \
CHECK(v->IsFunction()); \
env->set_async_hooks_##name##_function(v.As<Function>()); \
} while (0)

SET_HOOK_FN(init);
SET_HOOK_FN(before);
Expand Down Expand Up @@ -502,7 +505,7 @@ void AsyncWrap::Initialize(Local<Object> target,
Local<Object> constants = Object::New(isolate);
#define SET_HOOKS_CONSTANT(name) \
FORCE_SET_TARGET_FIELD( \
constants, #name, Integer::New(isolate, AsyncHooks::name));
constants, #name, Integer::New(isolate, AsyncHooks::name))

SET_HOOKS_CONSTANT(kInit);
SET_HOOKS_CONSTANT(kBefore);
Expand Down

0 comments on commit 3c70797

Please sign in to comment.