Re: [DOM4] Question about collections versus maps

On Tue, Apr 10, 2012 at 1:16 PM, Boris Zbarsky <bzbarsky@mit.edu> wrote:
> On 4/10/12 4:13 PM, Tab Atkins Jr. wrote:
>>
>> According to current WebIDL spec, an object with a named property
>> getter exposes the list of names as own properties, so you can get
>> them with for-in enumeration.
>
> 1)  for-in enumeration enumerates prototype properties.

Yes, but prototype properties aren't own properties, so you can tell them apart.

> 2)  for-in enumeration enumerates expandos which might have nothing to
>    do with the set of named properties.

It's not possible to set an expando on a map object like this.  (The
setter operation will either do something useful, or will reject the
attempt to set.)

~TJ

Received on Tuesday, 10 April 2012 20:24:05 UTC