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

Add PropertyDescriptor creation methods #29

Merged
merged 1 commit into from
Apr 28, 2017
Merged

Conversation

jasongin
Copy link
Member

Add static methods on the Napi::PropertyDescriptor class that provide convenient ways to construct PropertyDescriptor instances for different kinds of property descriptors. These are equivalent to the similar static methods on the ObjectWrap class, except they are for use when defining properties outside of an object-wrapping scenario. Callbacks are templatized (like with Function::New()) so that they can work with lambdas or regular function pointers.

New test cases cover the various overloads for constructing property descriptors and defining properties.

And the Name class constructors needed to be made public, to allow code like value.As<Name>(), that is used by the test.

Add static methods on the PropertyDescriptor class that provide
convenient ways to construct PropertyDescriptor instances for different
kinds of property descriptors. These are equivalent to the similar
static methods on the ObjectWrap class, except they are for use when
defining properties outside of an object-wrapping scenario. Callbacks
are templatized (like with Function::New()) so that they can work
with lambdas or regular function pointers.

New test cases cover the various overloads for constructing property
descriptors and defining properties.

And the Name class constructors needed to be made public, to allow
code like value.As<Name>(), that is used by the test.
@jasongin jasongin merged commit 97bc4c1 into nodejs:master Apr 28, 2017
@jasongin jasongin deleted the propdesc branch April 28, 2017 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants