Open annevk opened 6 years ago
I don't understand the contradiction; why can't you use getter/setter syntax and still have it define the internal slot?
You're right. We could always infer it from the getter (unless an override is in place). The only minor problem is you have to define both a getter and setter, but that is just as well as they need their own algorithm too (and might want different types as pointed out elsewhere).
The main drawback I see with explicit getters/setters as suggested in #485 is that we can no longer use the attribute name to also serve as an internal slot (if needed).
In particular, with
you could let IDL take care of ensuring there is an [[bodyUsed]] internal slot and also let IDL take care of defining that the getter returns that (you need to allow for the default to be overridden, but useful defaults are nice).
But perhaps it's not so bad to have to list both [[bodyUsed]] and getter in IDL and be a little more verbose. Not sure.
Opened this as a new issue to not distract from the main goal of making all things JavaScript-y, which I've been a long time supporter of.