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

tridge at samba.org tridge at samba.org
Tue May 31 01:48:04 GMT 2005


Author: tridge
Date: 2005-05-31 01:48:04 +0000 (Tue, 31 May 2005)
New Revision: 7127

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

Log:
allow for recursive ejs functions 




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


Changeset:
Modified: branches/SAMBA_4_0/source/lib/ejs/ejsParser.c
===================================================================
--- branches/SAMBA_4_0/source/lib/ejs/ejsParser.c	2005-05-31 01:44:44 UTC (rev 7126)
+++ branches/SAMBA_4_0/source/lib/ejs/ejsParser.c	2005-05-31 01:48:04 UTC (rev 7127)
@@ -1128,6 +1128,13 @@
 		mprDestroyVar(&v);
 		return EJS_STATE_ERR;
 	}
+
+	/* register the function name early to allow for recursive
+	   function calls (see note in ECMA standard, page 71) */
+	if (!(flags & EJS_FLAGS_ASSIGNMENT)) {
+		currentObj = ejsFindObj(ep, 0, procName, flags);
+		vp = mprSetProperty(currentObj, procName, &v);
+	}
 	
 	/*
 	 *	Parse the function body. Turn execute off.



More information about the samba-cvs mailing list