BAsh wrote:
Boris Zbarsky wrote:
BAsh wrote:
You can't return a JSObject to javascript - the interface has to be
declared as [noscript].
I need to pass a jobject (java object) back to javascript.
Oh. Hmm.
You could try creating a small nsISupports implementation whose
classinfo implements nsIXPCScriptable and has a PostCreate hook that
puts the jobject into the prototype chain...
That's the only thing I can think of offhand. Or you could do the
same and have a getProperty hook that just reports the jobject's
JSObject.
Either way, you can't really do this through XPConnect, unfortunately.
-Boris
I don't really understand that - so while I think through it, here is an
idea:
In javascript:
function MyObject() {
this.myVar = "HelloWorld";
this.myFunc = function(stuff) { ... }
}
I then pass this javascript object to my component:
myc++Component.method(new MyObject());
What would my in parameter be?
Could I convert the JSObject into a jsval and pass that back??
Is jsval scriptable??
_______________________________________________
dev-tech-xpcom mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-xpcom