bun icon indicating copy to clipboard operation
bun copied to clipboard

JS Setter is written as `Getter` in console.log

Open huseeiin opened this issue 1 year ago • 1 comments

What version of Bun is running?

1.0.26+c75e768a6

What platform is your computer?

Linux 6.1.66-1-lts x86_64 unknown

What steps can reproduce the bug?

const obj = {
  a: 1,
  get getA() {
    return this.a;
  },
  set setA(n) {
    this.a = n;
  },
};

obj.setA = 2;
console.log(obj.getA);
console.log(obj);

What is the expected behavior?

No response

What do you see instead?

No response

Additional information

No response

huseeiin avatar Feb 11 '24 15:02 huseeiin

I've had a go at this, but it seems like "make headers" and "make headers2" are broken (ETA: I'm not complaining about that, it's perfectly okay). I don't know how to regenerate the bindings files now, so I've just edited them by hand. I don't think that's the right way to go, though, so I won't open a PR for now.

https://github.com/argosphil/bun/commit/44b4dcb40ac073069cfa0784c79fc95841a03c55

The test should work, though.

https://github.com/argosphil/bun/commit/86199ef3b5e704a2b30f94dbad3266cf7126b672

argosphil avatar Feb 11 '24 18:02 argosphil