--- joe ertaba <[EMAIL PROTECTED]> wrote: > As in : > http://developer.mozilla.org/en/docs/wrappedJSObject, > when i use this code: > http://forums.mozillazine.org/viewtopic.php?p=1694347#1694347 > > var myService = Components.classes["@mozilla.doslash.org/test/component;1 > "].getService(); > myService.QueryInterface(Components.interfaces.*nsIObserver*); > dump(myService.observe) > > it works perfectly and output is "function observe() { [native code] }" > > but when i add some variable to code like: > > MyComponent.prototype = { > ... > MyVar:'hello', > .... > } > > then when i use above code again it works but the below code does not work > > dump(myService.MyVar) >> undefined > > maybe this problem cause because *nsIObserver ?* >
Yes, it is because of that. Why are you QueryInterface'ing for nsIObserver? Just do: var myService = Components.classes["@mozilla.doslash.org/test/component;1"].getService(); myService.wrappedJS.hello = "world"; dump(myService.wrappedJS.hello + "\n"); _______________________________________________ Project_owners mailing list [email protected] https://www.mozdev.org/mailman/listinfo/project_owners
