Re: Picking property by attribute

2008-08-11 Thread YR Chen
(Oops, forgot to reply all, so repost) But the syntax you propose is redundant, since you can define a own() method returning an iterator (for for...in) and a getOwn() method to do the same thing. Or, if you think getOwn() is ugly, you can customize the own() method to also return a "view" object:

Re: Picking property by attribute

2008-08-10 Thread Ingvar von Schoultz
YR Chen wrote: > There's no separate "namespace" for enumerable properties. This is about something else, something that's come up several times in the discussion archives. See for example this post: https://mail.mozilla.org/pipermail/es4-discuss/2007-March/000578.html > Also, let's not add synta

Re: Picking property by attribute

2008-08-09 Thread YR Chen
There's no separate "namespace" for enumerable properties. They are properties with a hidden enumerable flag set. With that said, in ES4, only non-fixed properties in the public namespace will be enumerable by default. That means that properties defined in classes will not be enumerable unless pref

Picking property by attribute

2008-08-08 Thread Ingvar von Schoultz
I think this would be useful: Get an enumerable property: var x = myDict [*enumerable] .someName; var x = myDict [*enumerable] [someVariable]; Call the non-enumerable .toString(): var x = myDict [*!enumerable] .toString(); Distinguish between owned and inherited properties: