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

Cannot give same name to getter and setter #100

Open
garyhai opened this issue Nov 8, 2020 · 0 comments
Open

Cannot give same name to getter and setter #100

garyhai opened this issue Nov 8, 2020 · 0 comments
Labels
bug Something isn't working derive macro help wanted Extra attention is needed work-around ways to work-around bug

Comments

@garyhai
Copy link
Contributor

garyhai commented Nov 8, 2020

    /// JS Setter
    /// Js:  obj.flag = 10;
    #[node_bindgen(setter, name = "flag")]
    fn set_flag(&mut self, val: bool) {
        self.flag = val;
    }

    /// JS getter
    /// Js:  let y = obj.flag;
    #[node_bindgen(getter, name = "flag")]
    fn get_flag(&self) -> bool {
        self.flag
    }

Same name failed to assign both setter and getter. It change getter name to "flag1", it works fine.

@sehz sehz added bug Something isn't working help wanted Extra attention is needed derive macro work-around ways to work-around bug labels Nov 19, 2020
@ajhunyady ajhunyady added the good first issue Good for newcomers label Nov 19, 2020
@sehz sehz removed the good first issue Good for newcomers label Nov 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working derive macro help wanted Extra attention is needed work-around ways to work-around bug
Projects
None yet
Development

No branches or pull requests

3 participants