-
Notifications
You must be signed in to change notification settings - Fork 29.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
src: replace IsConstructCall functions with lamda #12384
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM modulo nits. Typo in commit log: s/lamda/lambda/
src/cares_wrap.cc
Outdated
@@ -1399,24 +1384,27 @@ static void Initialize(Local<Object> target, | |||
target->Set(FIXED_ONE_BYTE_STRING(env->isolate(), "AI_V4MAPPED"), | |||
Integer::New(env->isolate(), AI_V4MAPPED)); | |||
|
|||
auto isConstructCall = [](const FunctionCallbackInfo<Value>& args) { | |||
CHECK(args.IsConstructCall()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only two spaces of indent and call the variable is_construct_call
(or is_construct_call_callback
to indicate it's a function pointer.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah again, must remember to not use camelcase 😞 Thanks!
3fc1684
to
ce11999
Compare
I noticed that there are three static functions that only check if args is a construct call. This commit suggests replacing them and them with a lambda.
ce11999
to
a440ec8
Compare
Landed in b280363 |
I noticed that there are three static functions that only check if args is a construct call. This commit suggests replacing them and them with a lambda. PR-URL: #12384 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: James M Snell <[email protected]>
Should this be backported to |
I noticed that there are three static functions that only check if
args is a construct call. This commit suggests replacing them and
them with a lamda.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
src