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

Ability to have property accessors for native objects #208

Closed
jugglingcats opened this issue May 22, 2017 · 1 comment
Closed

Ability to have property accessors for native objects #208

jugglingcats opened this issue May 22, 2017 · 1 comment

Comments

@jugglingcats
Copy link

It would be nice to be able to define first class properties with native objects. Psuedo-code:

declare_types! {

    /// JS class wrapping Employee records.
    pub class JsEmployee for Employee {

        property name {
            get(call) {
               // return the value
            }
            set(call) {
               // set the value
            }
        }
    }
};

There seems to be (or have been) a SetAccessor method in the v8 or NaN API, but hard to find good references to it!

@kjvalencik
Copy link
Member

declare_types have been deprecated. This feature would need to be part of classes 2.0.

neon-bindings/rfcs#43

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

No branches or pull requests

2 participants