Re: Passing back a java object

BAsh <[email protected]>
Newsgroups gmane.comp.mozilla.devel.java
Message-ID <uvqdnaM9eNDIV1TYnZ2dnUVZ_sfinZ2d__24649.947966873$1170854387$gmane$org@mozilla.org>
BAsh wrote:
> BAsh wrote:
>> BAsh wrote:
>>> How do you pass a jobject back from xpcom?
>>
>> This can be done from @mozilla.org/oji/jvm-mgr;1
>>
>> see: 
>> http://lxr.mozilla.org/mozilla1.8/source/modules/oji/src/nsJVMManager.h#179 
>>
>>
>> How do you get a JSContext then??
> 
> http://lxr.mozilla.org/mozilla1.8/source/content/base/src/nsDocument.cpp#4409 
> 
> 
> 4403   nsIScriptGlobalObject* globalObject = 
> nsIDocument.GetScriptGlobalObject();
> 4404   NS_ENSURE_TRUE(globalObject, PR_TRUE);
> 4405 4406   nsIScriptContext *scriptContext = globalObject->GetContext();
> 4407   NS_ENSURE_TRUE(scriptContext, PR_TRUE);
> 4408 4409   JSContext* cx = (JSContext *) 
> scriptContext->GetNativeContext();
> 4410   NS_ENSURE_TRUE(cx, PR_TRUE);
Any interface that returns a JSObject must be [noscript]. This defeats the purpose of returning a JSObject. How do you return a jobject (a java object) from c++ to javascript????????
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.