public JSFunction convert(Object obj) {
Scriptable scope = (Scriptable) obj;
String name = Util.stringValue("name", scope);
int line = Util.intValue("line", scope);
Builder b = new JSFunction.Builder(name, line);
b.last(Util.intValue("last", scope));
for (String param : Util.listValueOfType("parameter", String.class, scope)) {
b.addParam(param);
}
for (String closure : Util.listValueOfType("closure", String.class, scope)) {
b.addClosure(closure);