Adding js functionality to existing ScriptObjectMirror

Attila Szegedi attila.szegedi at oracle.com
Mon Mar 23 15:48:51 UTC 2015


As a minor point, type safety wise, I'd suggest you program for the JSObject interface whenever you can instead of for the ScriptObjectMirror concrete type. Just future-proofing it :-)

Attila.

On Mar 23, 2015, at 2:06 PM, BURRIS Thomas <Thomas.BURRIS at 3ds.com> wrote:

> Hi ... I have a cache of ScriptObjectMirrors (SOM) that wrap some compiled javascript and -- at runtime -- I need to inject an additional function into the SOMs. Something like this
> 
>     ScriptObjectMirror som = SOMPool.get();
>     som.setMember("someFn", <WHAT-HERE?>);
> 
>     // so that I am now enabled to do this:
>     som.callMember("someFn", "arg1", "arg2");
> 
> 
> Possible? I've tried a bunch of approaches, none have worked.
> 
> thanks!
> 
> This email and any attachments are intended solely for the use of the individual or entity to whom it is addressed and may be confidential and/or privileged.
> 
> If you are not one of the named recipients or have received this email in error,
> 
> (i) you should not read, disclose, or copy it,
> 
> (ii) please notify sender of your receipt by reply email and delete this email and all attachments,
> 
> (iii) Dassault Systemes does not accept or assume any liability or responsibility for any use of or reliance on this email.
> 
> For other languages, go to http://www.3ds.com/terms/email-disclaimer



More information about the nashorn-dev mailing list