throw ScriptRuntime.constructError("Error", "Constructor takes a single argument");
}
FeatureCollection collection = null;
Object arg = args[0];
if (arg instanceof NativeObject) {
NativeObject config = (NativeObject) arg;
if (inNewExpr) {
collection = new FeatureCollection(config);
} else {
collection = new FeatureCollection(config.getParentScope(), config);
}
} else if (arg instanceof NativeArray) {
NativeArray array = (NativeArray) arg;
if (inNewExpr) {
collection = new FeatureCollection(array);