On Nov 21, 2007 9:38 AM, joe ertaba <[EMAIL PROTECTED]> wrote:
> As in :
>           http://developer.mozilla.org/en/docs/wrappedJSObject

You didn't post any of the wrappedJSObject-related code from that
page. I hoped that page was pretty clear, but if you can suggest
improvements, please do.

> myService.QueryInterface(Components.interfaces. nsIObserver);
> dump(myService.observe)
>
> it works perfectly and output is " function observe() { [native code] }"
>
..which is defined in the nsIObserver interface, so is known to the
XPConnect wrapper you have in myService. The JS object properties that
are not part of any interface the wrapper knows about are not visible
to your code working with the wrapper.

> but when i add some variable to code like:
>
> MyComponent.prototype = {
>
> ...
> MyVar:'hello',

BTW, I would instead define the var in the MyComponent constructor,
it's probably closer to what you need:

function MyComponent() { this.myVar = "hello"; }

Nickolay
_______________________________________________
Project_owners mailing list
[email protected]
https://www.mozdev.org/mailman/listinfo/project_owners

Reply via email to