- From: Brendan Eich <brendan@mozilla.org>
- Date: Fri, 19 Feb 2010 16:32:39 -0800
- To: Simon Pieters <simonp@opera.com>
- Cc: "Boris Zbarsky" <bzbarsky@mit.edu>, "Mark S. Miller" <erights@google.com>, "public-script-coord@w3.org" <public-script-coord@w3.org>
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. /be
Received on Saturday, 20 February 2010 00:36:29 UTC