Java 6 Scripting API vs Rhino
Apologies if this isn't the right place for this question, but I can't see a more appropriate forum.
I have some classes that use the Mozilla Rhino API for invoking javascript, and I was planning to upgrade this to use the new javax.script classes in Java 6. However, there's one particular feature that seems to be missing.
In Rhino, you invoke JS functions through the Function class (See http://www.mozilla.org/rhino/apidocs/org/mozilla/javascript/Function.html). This has a method construct()
which invokes a JS function that has been implemented as a constructor, and returns the new JS object.
I can't find an equivalent method in the javax.script API. Am I missing something? Or was this feature deliberately left out because the new API is designed to be more general purpose, and support langauges that don't have constructors?
Thanks,
Alasdair

