Re: Node's __proto__

"Eric J. Van der Velden" <[email protected]> Sun, 18 Mar 2012 11:12:24 -0700 (PDT)
Newsgroups gmane.comp.mozilla.devel.dom
Organization http://groups.google.com
Message-ID <3b67bdd0-5ac8-45f5-b776-a0e6091863c9@h20g2000yqd.googlegroups.com>
On Mar 16, 8:30=A0pm, Boris Zbarsky <[email protected]> wrote:
> On 3/16/12 3:15 PM, Eric J. Van der Velden wrote:
>
> > I understand for example that
> > Node.prototype.__proto__=3D=3D=3DObject.prototype, but although
> > uninteresting, I still would like to know what I should write on
> > the ... in Node.__proto__=3D=3D=3D....prototype.
>
> Per future specs, Node.__proto__ =3D=3D=3D Function.prototype, since Node=
 is a
> Function object.
>
> In Gecko's current implementation, it depends. =A0In the new DOM bindings,
> the interface object's proto should be Function.prototype. =A0In the
> XPConnect bindings (which Node is at the moment, but hopefully not for
> much longer), I have no idea offhand.
>
> > Because Object is a function, Object.__proto__=3D=3D=3DFunction.prototy=
pe.
> > So I thought: Function.__proto__=3D=3D=3DFunction.prototype. I thought
> > Function in JavaScript similar to Object in Java. But it is not true.
>
> Function.__proto__ =3D=3D=3D Function.prototype, yes.
>
> Node is special, because it's actually a host object at the moment.
>
> > Also what do you mean by "each prototype has a flattened version of
> > all methods and properties it inherits"?
>
> That wasn't relevant to your question; it was about Node.prototype.
>
> -Boris

Hi Boris,

Thank you very much.

Function is defined in SpiderMonkey. Where is Node defined?

Thanks,

Eric J.