Re: [heycam/webidl] [wip] First pass at adding internal slots (#495)

> Please add the actual syntax to the interface.

So we agree that this would only be for custom slots, right? i.e. the following snippet would have both a `[[secret]]` and a `[[name]]` slot, right?

```
interface Person {
  [[secret]];
  attribute DOMString name;
};
```

> I don't think we should include an initial value. First, these are just attributes that happen to not have a public getter/setter, and attributes don't have initial values defined in the IDL;

So I'm not really sure whether initial values are useful or not. But if we think so, then the idea would be to add them to both slots and attributes:

```
interface Person {
  [[secret]] = "45e8173d40ddff8dcf81697326e094bcf8b92920";
  attribute DOMString name = "John Doe";
};
```

`this.[[secret]]` would have the value "`45e8173d40ddff8dcf81697326e094bcf8b92920`" and `this.[[name]]` would hold the string "`John Doe`".



-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/heycam/webidl/pull/495#issuecomment-350853472

Received on Monday, 11 December 2017 20:49:16 UTC