Re: [heycam/webidl] Extend the dfn of object types. (#211)

@bzbarsky wrote:
> Here's a concrete example of why the current [SameObject] thing is silly: Node has various string-or-null-valued attributes (localName, namespaceID) that can never change and we should be able to annotate that. Right now we can't.

Oh, OK. So there are requirements I wasn't aware of.

So what's the plan?

1. Define object types as:
    ```
The {{object}} type,
all [=interface types=],
the [=promise type=],
the [=exception types=],
the [=buffer source types=], and
[=union types=] whose [=member types|members=] are [=object types=]
are known as <dfn id="dfn-object-type" export>object types</dfn>.
```
    
2. Make [NewObject] refer to it.
3. Add a new [Constant] extended attribute that's works on any type and always returns the same reference for objects and the same value otherwise (so `[Constant] readonly attribute DOMString tagName;` means that if tagName returns "DIV" once, it'll always do so.)
4. What to do with [SameObject]? Mark it as legacy?

@annevk wrote:
> do we have a case where a [NewObject]-operation can return null or a string? On the face of it something like that seems rather weird.

I wasn't aware string was a requirement for [SameObject]. Agreed it's potentially a bit weird for [NewObject] but `null` doesn't strike me as absurd.


-- 
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/211#issuecomment-259177313

Received on Tuesday, 8 November 2016 16:03:26 UTC