Skip to content

Commit 3c70797

Browse files
gengjiawentargos
authored andcommitted
src: remove extra semicolons after macros
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]>
1 parent 8cba1af commit 3c70797

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/async_wrap.cc

+10-7
Original file line numberDiff line numberDiff line change
@@ -294,12 +294,15 @@ static void SetupHooks(const FunctionCallbackInfo<Value>& args) {
294294

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

297-
#define SET_HOOK_FN(name) \
298-
Local<Value> name##_v = fn_obj->Get( \
299-
env->context(), \
300-
FIXED_ONE_BYTE_STRING(env->isolate(), #name)).ToLocalChecked(); \
301-
CHECK(name##_v->IsFunction()); \
302-
env->set_async_hooks_##name##_function(name##_v.As<Function>());
297+
#define SET_HOOK_FN(name) \
298+
do { \
299+
Local<Value> v = \
300+
fn_obj->Get(env->context(), \
301+
FIXED_ONE_BYTE_STRING(env->isolate(), #name)) \
302+
.ToLocalChecked(); \
303+
CHECK(v->IsFunction()); \
304+
env->set_async_hooks_##name##_function(v.As<Function>()); \
305+
} while (0)
303306

304307
SET_HOOK_FN(init);
305308
SET_HOOK_FN(before);
@@ -502,7 +505,7 @@ void AsyncWrap::Initialize(Local<Object> target,
502505
Local<Object> constants = Object::New(isolate);
503506
#define SET_HOOKS_CONSTANT(name) \
504507
FORCE_SET_TARGET_FIELD( \
505-
constants, #name, Integer::New(isolate, AsyncHooks::name));
508+
constants, #name, Integer::New(isolate, AsyncHooks::name))
506509

507510
SET_HOOKS_CONSTANT(kInit);
508511
SET_HOOKS_CONSTANT(kBefore);

0 commit comments

Comments
 (0)