summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/lib/ejs/ejsProcs.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/source4/lib/ejs/ejsProcs.c b/source4/lib/ejs/ejsProcs.c
index 39df18ef94..b15985c8cf 100644
--- a/source4/lib/ejs/ejsProcs.c
+++ b/source4/lib/ejs/ejsProcs.c
@@ -171,7 +171,7 @@ static int arrayConsProc(EjsHandle eid, int argc, MprVar **argv)
mprAssert(obj);
- if (argc == 1) {
+ if (argc == 1 && mprVarIsNumber(argv[0]->type)) {
/*
* x = new Array(size);
*/
@@ -181,7 +181,7 @@ static int arrayConsProc(EjsHandle eid, int argc, MprVar **argv)
mprItoa(i, idx, sizeof(idx));
mprCreateProperty(obj, idx, &undef);
}
- } else if (argc > 1) {
+ } else {
/*
* x = new Array(element0, element1, ..., elementN):
*/
@@ -190,9 +190,6 @@ static int arrayConsProc(EjsHandle eid, int argc, MprVar **argv)
mprItoa(i, idx, sizeof(idx));
mprCreateProperty(obj, idx, argv[i]);
}
-
- } else {
- max = 0;
}
lp = mprCreatePropertyValue(obj, "length", mprCreateIntegerVar(max));