W3C home > Mailing lists > Public > public-script-coord@w3.org > April to June 2014

Re: Exposing constructors of readonly interfaces to web authors

From: Brendan Eich <brendan@secure.meer.net>
Date: Mon, 30 Jun 2014 08:51:18 -0400
Message-ID: <53B15D46.6090001@secure.meer.net>
To: Rik Cabanier <cabanier@gmail.com>
CC: Domenic Denicola <domenic@domenicdenicola.com>, Dirk Schulze <dschulze@adobe.com>, Anne van Kesteren <annevk@annevk.nl>, "public-script-coord@w3.org" <public-script-coord@w3.org>
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 

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

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

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:14:22 UTC