Nov 18 notes

Brendan Eich brendan at mozilla.com
Mon Nov 22 12:48:35 PST 2010


On Nov 22, 2010, at 12:39 PM, Brendan Eich wrote:

> On Nov 22, 2010, at 12:09 PM, Oliver Hunt wrote:
>> 
>> How do library authors help?  They can't add value enumeration of anything as that will break any existing code that uses for(in) over any of their objects.
> 
> As Tom pointed out (re-read his message :-|), they can make enumeration work for large/lazy/infinite objects. No non-string non-keys required.

The important point here is that for-in won't choke old browsers. New library code in the near term (when Harmony and pre-Harmony impls are in the field), assuming we let for-in be metaprogrammed in Harmony, can object-detect and meta-program for-in, and client *and* library code can use for-in and it will fail soft or fall back by other means.

Not so if we add new syntax (for-: or anything old browsers will choke on).

/be


More information about the es-discuss mailing list