Re: Exposing constructors of readonly interfaces to web authors

Rik Cabanier wrote:
> Given this, can you ever use attributes in JS object and have them 
> return the same getter function?

Sure, you can.

> Can we ever use attributes in the DOM?

Of course, and lots of WebIDL-based specs do. These go on constructors' 
prototype objects.

> Also, who relies on them being the same? That seems like a strange 
> assumption.

Specs need to be complete with respect to function identity, since 
functions are mutable objects. The N >> 1 instance vs. prototype 
population means functions per instance is too expensive; it's easy to 
measure.

So, developers will notice if there's no prototype-based sharing. And 
implementors must know what to do.

/be

Received on Monday, 30 June 2014 12:51:48 UTC