I was using ClearScript
with .NET
to expose Classes to Javascript. I used this to expose class (not instance of class to JS) : engine.AddHostType("Worker", typeof(Worker));
So I could use var x = new Worker();
In javascript
;
Now in Nashorn
with Java this does not work. I am only able to expose instance of class like this : factory.getBindings().put("Worker", new Worker());
Is there a way to expose class type to javascript with Nashorn.
Thank you!