Yes, shadowing is also a good point to stratify the meta level. OTOH, shadowing in respect of a simple inheritance can also be a normal case.

This is the case, repeat, why e.g. __proto__ is eliminated (there were some issues with JSON.parse where the parsed object automatically get the prototype). But, magic names -- they are exactly for that to be magic names. If there is a convention that __names__ are reserved, just don't use them as casual properties, or be prepared that the "magic" effect will happened, which isn't a magic of course if there is convention.

Dmitry.

On 01.03.2011 13:04, Poetro wrote:
I like the idea of having it on the Object object. The main thing is,
that in JavaScript a lot of programmers use Objects as hashtables. I
already have the pain of writing out
Object.prototype.hasOwnProperty.call when i want to enumerate through
objects (I know it could be replaced by variable, but still).
Object.keys is clean in this aspect, i dont have to worry about, if
one of the object's keys i got from a 3rd party API includes the key
`keys`, I just use Object.keys, and I'm still safe (unless someone
overwrites Object.keys, which is quite unlikely, and maybe it can be
prevented in ES5).


--
Poetro


--
To view archived discussions from the original JSMentors Mailman list: 
http://www.mail-archive.com/[email protected]/

To search via a non-Google archive, visit here: 
http://www.mail-archive.com/[email protected]/

To unsubscribe from this group, send email to
[email protected]

Reply via email to