W3C home > Mailing lists > Public > public-script-coord@w3.org > January to March 2010

Re: DOMString-like objects for the CSSOM

From: Brendan Eich <brendan@mozilla.org>
Date: Fri, 19 Feb 2010 16:32:39 -0800
Cc: "Boris Zbarsky" <bzbarsky@mit.edu>, "Mark S. Miller" <erights@google.com>, "public-script-coord@w3.org" <public-script-coord@w3.org>
Message-Id: <8E474A44-1295-42A9-B07D-99EF3B119961@mozilla.org>
To: Simon Pieters <simonp@opera.com>
On Feb 19, 2010, at 3:53 PM, Simon Pieters wrote:

> On Fri, 19 Feb 2010 17:40:16 +0100, Boris Zbarsky <bzbarsky@mit.edu>  
> wrote:
>>> 'f' in 'x'
>>> TypeError: Cannot use 'in' operator to search for 'f' in x
>> This is more serious, since it could hinder object-detection of the  
>> new properties....
>> Thank you for bringing that up.
> It would hinder object detection using if ('px' in foo.top), but  
> object detection using if (foo.top.px != undefined) would work fine.

There are lots of ways to detect, but breaking compatibility and  
breaking invariants such as ('px' in foo.top) -> throw TypeError are  
not to be done lightly.

It is not clear to me why a better API needs to extend property  
reference syntax off the deep end of this pier. What's the attraction?

Conversion of number to string and back can be optimized, and is being  
optimized in competitive JS VMs.

Received on Saturday, 20 February 2010 00:36:29 UTC

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