}
Scriptable fieldConfig = cx.newObject(scope);
fieldConfig.put("name", fieldConfig, name);
fieldConfig.put("type", fieldConfig, typeName);
if (jsValue instanceof Geometry) {
Projection projection = ((Geometry) jsValue).getProjection();
if (projection != null) {
fieldConfig.put("projection", fieldConfig, projection.getId());
}
}
Field field = new Field(scope, (NativeObject) fieldConfig);
fields.put(i, fields, field);
}