Skip to content

src,test: allow creating Function with move-only functor#1065

Merged
NickNaso merged 1 commit intonodejs:mainfrom
strager:move-only-functor
Sep 17, 2021
Merged

src,test: allow creating Function with move-only functor#1065
NickNaso merged 1 commit intonodejs:mainfrom
strager:move-only-functor

Conversation

@strager
Copy link
Copy Markdown
Contributor

@strager strager commented Sep 7, 2021

Function::New fails to compile when given a move-only functor. For
example, when constructing a callback function for Promise#then, a
lambda might capture an ObjectReference. Creating a Function for such a
lambda results in a compilation error.

Tweak Function::New to work with move-only functors.

For existing users of Function::New, this commit should not change
behavior.

Function::New fails to compile when given a move-only functor. For
example, when constructing a callback function for Promise#then, a
lambda might capture an ObjectReference. Creating a Function for such a
lambda results in a compilation error.

Tweak Function::New to work with move-only functors.

For existing users of Function::New, this commit should not change
behavior.
Copy link
Copy Markdown
Member

@mhdawson mhdawson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I think this looks ok. @gabrielschulhof do you see any concerns?

@NickNaso
Copy link
Copy Markdown
Member

Copy link
Copy Markdown
Member

@NickNaso NickNaso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mhdawson
Copy link
Copy Markdown
Member

@NickNaso I think you were going to land this if I remember correctly?

@NickNaso
Copy link
Copy Markdown
Member

@NickNaso I think you were going to land this if I remember correctly?

Yes, I will do it later, today. After the merge I will need to make a new release 4.2.0 is it right?

@mhdawson
Copy link
Copy Markdown
Member

I will need to make a new release 4.2.0 is it right?

Yes since this added functionality I marked it as SemVer minor and we should bump the minor part in the next release.

@NickNaso NickNaso mentioned this pull request Sep 16, 2021
@NickNaso NickNaso merged commit 2dc1f5b into nodejs:main Sep 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants