infinyon / infinyon/node-bindgen

Cannot give same name to getter and setter

Open
#100 0 comments 0 reactions 0 assignees View on GitHub
bug derive macro help wanted work-around
Dominant language
Rust
Stars
587
Forks
43
PR merge metrics
No merged PRs in 30d

Description

```rust
/// 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.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the Rust attribute-macro case shown, using the same getter and setter name. Trace how getter and setter names are handled, then add a regression test confirming both bindings work with the shared name.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, rust
Domain
api, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.