svn commit: samba r7124 - in branches/SAMBA_4_0/source/lib/ejs: .

tridge at samba.org tridge at samba.org
Tue May 31 01:16:02 GMT 2005


Author: tridge
Date: 2005-05-31 01:16:01 +0000 (Tue, 31 May 2005)
New Revision: 7124

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=7124

Log:
fixed a bug in array construction (see ECMA standard section 15.4.2.2)

Modified:
   branches/SAMBA_4_0/source/lib/ejs/ejsProcs.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/ejs/ejsProcs.c
===================================================================
--- branches/SAMBA_4_0/source/lib/ejs/ejsProcs.c	2005-05-31 00:58:00 UTC (rev 7123)
+++ branches/SAMBA_4_0/source/lib/ejs/ejsProcs.c	2005-05-31 01:16:01 UTC (rev 7124)
@@ -171,7 +171,7 @@
 	mprAssert(obj);
 
 
-	if (argc == 1) {
+	if (argc == 1 && mprVarIsNumber(argv[0]->type)) {
 		/*
 		 *	x = new Array(size);
 		 */
@@ -181,7 +181,7 @@
 			mprItoa(i, idx, sizeof(idx));
 			mprCreateProperty(obj, idx, &undef);
 		}
-	} else if (argc > 1) {
+	} else {
 		/*
 		 *	x = new Array(element0, element1, ..., elementN):
 		 */
@@ -190,9 +190,6 @@
 			mprItoa(i, idx, sizeof(idx));
 			mprCreateProperty(obj, idx, argv[i]);
 		}
-
-	} else {
-		max = 0;
 	}
 
 	lp = mprCreatePropertyValue(obj, "length", mprCreateIntegerVar(max));



More information about the samba-cvs mailing list