public Object exec(List arguments) throws TemplateModelException {
Context cx = Context.getCurrentContext();
Object[] args = arguments.toArray();
BeansWrapper wrapper = getWrapper();
for (int i = 0; i < args.length; i++) {
args[i] = wrapper.unwrap((TemplateModel)args[i]);
}
return wrapper.wrap(((Function)getScriptable()).call(cx,
ScriptableObject.getTopLevelScope(fnThis), fnThis, args));
}
}