} catch (Exception exc) {
throw Context.reportRuntimeError(exc.getMessage());
}
}
} else if (e instanceof ValueChangedEvent) {
ValueChangedEvent vce = (ValueChangedEvent)e;
Object obj = super.get("onChange", this);
if (obj instanceof Function) {
try {
Function fun = (Function)obj;
Object[] args = new Object[2];
Scriptable scope = getTopLevelScope(this);
Scriptable thisObj = scope;
Context cx = Context.getCurrentContext();
args[0] = vce.getOldValue();
args[1] = vce.getNewValue();
fun.call(cx, scope, thisObj, args);
} catch (Exception exc) {
throw Context.reportRuntimeError(exc.getMessage());
}
}