infinyon / infinyon/node-bindgen
Cannot give same name to getter and setter
- 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
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