Re: Node's __proto__

Bobby Holley <[email protected]> Sun, 11 Mar 2012 23:00:37 -0700
Newsgroups gmane.comp.mozilla.devel.dom
Message-ID <CAKBxTc+6TEeN=CCLPZpjH9mFAOYf6xkuRQeCzaAxj+-RbQAG6Q@mail.gmail.com>
Hi Eric,

|Node| and |Element| are both constructor objects. They both have the same
proto, and it's very uninteresting (the proto of that object is
Object.prototype).

Things like |Node| and |Element| are just kind of waystations on the way to
things like Node.prototype and Element.prototype. Those are the __proto__s
for actual Node and Element instances, and they form a nice inheritance
hierarchy (ie: Element.prototype.__proto__ === Node.prototype).

But we also do a lot of that stuff wrong in Gecko, as it stands. For
example, each prototype has a flattened version of all methods and
properties it inherits. But we're fixing this all soon.

Cheers,
bholley

On Sun, Mar 11, 2012 at 6:49 AM, Eric J. Van der Velden <
[email protected]> wrote:

> Hello,
>
> What is Node.__proto__ , or Element.__proto__ ?
>
> Thanks
>
> Eric J.
> _______________________________________________
> dev-tech-dom mailing list
> [email protected]
> https://lists.mozilla.org/listinfo/dev-tech-dom
>