Re: [WebIDL] Would it make sense to add annotations for "creates a new object each time" and "always returns the same object"?

On 10/23/12 6:44 PM, Jonas Sicking wrote:
> However I agree that attribute getters in general should be returning
> the same object. So obj.attr === obj.attr should in general return
> true. Though I suspect that there are several cases where changing the
> object state will also change what object it returns.

Indeed.  For getters the useful annotation is when there is no way to 
change internal state in a way that affects the return value.

So .firstChild would not be able to be annotated in this way, while 
.style would be, for example.

-Boris

Received on Wednesday, 24 October 2012 00:32:40 UTC