XPCom object identity for XPConnect objects.

2004-12-23 Thread Peter Wilson
How do I detect if two JS wrapped XPCom Objects refer to the same XPCom 
object?

For example in Javascript:
	anXULElement.previousSibling.nextSibling is not === anXULElement nor is 
it ==.

The JS wrapper objects refer to a common XPCOM object (in this case the 
XULELement). How do I check for equality of objects referenced?



___
Mozilla-xpcom mailing list
Mozilla-xpcom@mozilla.org
http://mail.mozilla.org/listinfo/mozilla-xpcom


Re: XPCom object identity for XPConnect objects.

2004-12-23 Thread Mike Shaver
Peter Wilson wrote:
How do I detect if two JS wrapped XPCom Objects refer to the same XPCom 
object?

For example in Javascript:
anXULElement.previousSibling.nextSibling is not === anXULElement nor 
is it ==.

The JS wrapper objects refer to a common XPCOM object (in this case the 
XULELement). How do I check for equality of objects referenced?
It's likely that anXULElement is not a wrapper around the nsIDOMNode 
interface, and just as with XPCOM in C++, you need to compare the same 
interface pointer type when checking identity.  Try QueryInterfacing to 
nsISupports on both and see if that helps.

Mike
___
Mozilla-xpcom mailing list
Mozilla-xpcom@mozilla.org
http://mail.mozilla.org/listinfo/mozilla-xpcom