Skip to content

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

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

Merged
merged 1 commit into from
Sep 17, 2021

Conversation

strager
Copy link
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
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?

Copy link
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
Member

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

@NickNaso
Copy link
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
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