In the sun.org.mozilla version of Rhino, JavaAdapter
only takes interfaces as its first argument instead of any other kind of class according to this error message:
javax.script.ScriptException: sun.org.mozilla.javascript.internal.EvaluatorExcep
tion: JavaAdapter: first arg should be interface Class (<Unknown source>#11) in
<Unknown source> at line number 11
Is there any way, no matter how hacky, to extend an abstract class (or a normal class for that matter) via Rhino?
Here is the offending code:
var j = new JavaAdapter(foo.bar.abstractClass, {
field : "test",
method : function () {
print("on enable");
}
});