W3C home > Mailing lists > Public > public-webapps@w3.org > April to June 2009

Re: [PrototypeRoot]

From: Ian Hickson <ian@hixie.ch>
Date: Sat, 20 Jun 2009 07:43:43 +0000 (UTC)
To: Garrett Smith <dhtmlkitchen@gmail.com>
Cc: WebApps WG <public-webapps@w3.org>
Message-ID: <Pine.LNX.4.62.0906200739350.16244@hixie.dreamhostps.com>
On Sat, 20 Jun 2009, Garrett Smith wrote:
> I still want to know: Why would a program want to know the object's 
> [[Class]]?

It shouldn't, but [[Class]]es are exposed by ECMAScript objects in their 
toString() method and thus if we want to ensure universally consistent 
behaviour we have to define this.

> Even if a program could know the [[Class]], what's to say it won't 
> change in the future?

The specs we write.

> Given a particular object, can that object's [[Class]] property change 
> in the future? If it there is an object that exists, say, some sort of 
> HTMLCollection, and it becomes desirable to make more specific behavior, 
> say "HTMLFormControlsCollection", what would the code that expects the 
> object's class to be HTMLCollection need to do to continue working in 
> multiple versions of multiple browsers?

We would have to test to see if any pages rely on it; if they do, we'd 
have to make sure we don't change the [[Class]] somehow.

> Given all these reasons, it would still seem like a bad idea to program 
> to an object's [[Class]]. Instead, the interface should be programmed to 
> using feature detection.


Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Saturday, 20 June 2009 07:44:16 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:12:54 UTC