Adding js functionality to existing ScriptObjectMirror

BURRIS Thomas Thomas.BURRIS at
Mon Mar 23 13:06:37 UTC 2015

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.


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

More information about the nashorn-dev mailing list