public Object call(Context ctx, Scriptable scope,
Scriptable thisObj, Object[] args) {
NativeJavaObject njo = (NativeJavaObject)thisObj;
if (args[2] instanceof Function) {
EventListener evtListener = new FunctionEventListener
((Function)args[2], interpreter);
listenerMap.put(args[2], new SoftReference(evtListener));
// we need to marshall args
Class[] paramTypes = { String.class, String.class,
Function.class, Boolean.TYPE,
Object.class };
for (int i = 0; i < args.length; i++)
args[i] = Context.jsToJava(args[i], paramTypes[i]);
AbstractNode target = (AbstractNode) njo.unwrap();
target.addEventListenerNS
((String)args[0],
(String)args[1],
evtListener,
((Boolean)args[3]).booleanValue(),
args[4]);
return Undefined.instance;
}
if (args[2] instanceof NativeObject) {
EventListener evtListener =
new HandleEventListener((Scriptable)args[2], interpreter);
listenerMap.put(args[2], new SoftReference(evtListener));
// we need to marshall args
Class[] paramTypes = { String.class, String.class,
Scriptable.class, Boolean.TYPE,