Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

@danbev
Copy link
Member

commented Apr 13, 2017

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), or vcbuild test (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)

src

@danbev

This comment has been minimized.

Copy link
Member Author

commented Apr 13, 2017

@bnoordhuis
Copy link
Member

left a comment

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());

This comment has been minimized.

Copy link
@bnoordhuis

bnoordhuis Apr 13, 2017

Member

Only two spaces of indent and call the variable is_construct_call (or is_construct_call_callback to indicate it's a function pointer.)

This comment has been minimized.

Copy link
@danbev

danbev Apr 13, 2017

Author Member

Ah again, must remember to not use camelcase 😞 Thanks!

@danbev danbev force-pushed the danbev:cares_wrap-lamda branch Apr 13, 2017

@danbev

This comment has been minimized.

Copy link
Member Author

commented Apr 13, 2017

@refack refack force-pushed the nodejs:master branch to fbe946b Apr 14, 2017

src: replace IsConstructCall functions with lambda
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.

@danbev danbev force-pushed the danbev:cares_wrap-lamda branch to a440ec8 Apr 15, 2017

@danbev

This comment has been minimized.

Copy link
Member Author

commented Apr 15, 2017

@addaleax

This comment has been minimized.

Copy link
Member

commented Apr 15, 2017

Landed in b280363

@addaleax addaleax closed this Apr 15, 2017

addaleax added a commit that referenced this pull request Apr 15, 2017
src: replace IsConstructCall functions with lambda
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 <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>

@danbev danbev deleted the danbev:cares_wrap-lamda branch Apr 18, 2017

@AndreasMadsen AndreasMadsen referenced this pull request May 8, 2017
3 of 4 tasks complete
@jasnell jasnell referenced this pull request May 11, 2017
@gibfahn gibfahn referenced this pull request Jun 15, 2017
2 of 3 tasks complete
@gibfahn

This comment has been minimized.

Copy link
Member

commented Jun 18, 2017

Should this be backported to v6.x-staging? If yes please follow the guide and raise a backport PR, if no let me know or add the dont-land-on label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants
You can’t perform that action at this time.