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

Syntactic changes to attributes #488

Open
annevk opened this issue Dec 6, 2017 · 2 comments
Open

Syntactic changes to attributes #488

annevk opened this issue Dec 6, 2017 · 2 comments
Labels

Comments

@annevk
Copy link
Member

annevk commented Dec 6, 2017

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

  readonly attribute boolean bodyUsed;

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.

@annevk annevk added the jsidl label Dec 6, 2017
@littledan
Copy link
Collaborator

I don't understand the contradiction; why can't you use getter/setter syntax and still have it define the internal slot?

@annevk
Copy link
Member Author

annevk commented Dec 6, 2017

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants