On 8/21/07, amemail1234-moz@yahoo.com wrote:
>
> Hello All,
>
> Is it illegal to access a method in one javascript
> XPCOM component from another javascript xpcom
> component? Do I need to explicitly define an IDL?
>

If you're dealing with an object that is wrapped by XPConnect, you can
only access the properties defined in the interfaces you QI'd the
object to. One exception: if your object is JS and has a
wrappedJSObject property, you can access that property on the wrapper
as well.

> // Bar's observe() method
> observe: function(subject, topic, data)
> {
> if(topic == "test-work-added")
> {
> this.dumpln("observed: test-work-added");
> this.doWork(subject);


here |subject| is likely an XPConnect wrapper. If you pass
subject.wrappedJSObject to doWork, everything should work fine.

Nickolay