> But I've heard Brenden Eich doesn't think  __proto__ is a good idea anymore.

__proto__ is great, has a long history of support (at least 13yrs),
and is now supported by every major browser (Safari, Chrome, Firefox,
Opera), except IE.
It's also available in server-side JS enviros like Narwhal, RingoJS
(with flags), Node, and Rhino, as well as many smart phones, and even
Adobe AIR/Flash.

Because of that long history of support and increased adoption I think
__proto__ will be around for a while and that's a good thing.
Its functionality should be ECMA-ized and made part of the spec. It
could be under a different name, or made into a method, or extended to
respect property descriptors set on it, and so on.

I use __proto__ as one of the techniques to create sandboxed natives
(http://msdn.microsoft.com/en-us/scriptjunkie/gg278167).
Some of the newer/edge jazz (Object.create, proxies, Context) may
offer similar but not the same functionality.
As far as I know __proto__ is the only one that will preserve the
[[Class]] of the object.

Ex: var a = [1,2,3]; a.__proto__ = b.prototype;
alert({}.toString.call(a)); // [object Array]

-JDD

-- 
To view archived discussions from the original JSMentors Mailman list: 
http://www.mail-archive.com/jsmentors@jsmentors.com/

To search via a non-Google archive, visit here: 
http://www.mail-archive.com/jsmentors@googlegroups.com/

To unsubscribe from this group, send email to
jsmentors+unsubscr...@googlegroups.com

Reply via email to