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 <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
  • Loading branch information
gengjiawen authored and ZYSzys committed May 12, 2019
1 parent a244b6f commit 1d31c68
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 1d31c68

Please sign in to comment.