git.samba.org
/
samba.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
46adb4a
)
r7127: allow for recursive ejs functions
author
Andrew Tridgell
<tridge@samba.org>
Tue, 31 May 2005 01:48:04 +0000
(
01:48
+0000)
committer
Gerald (Jerry) Carter
<jerry@samba.org>
Wed, 10 Oct 2007 18:17:20 +0000
(13:17 -0500)
source/lib/ejs/ejsParser.c
patch
|
blob
|
history
diff --git
a/source/lib/ejs/ejsParser.c
b/source/lib/ejs/ejsParser.c
index d42d66bcf53afd6cb7adece16c429f4f6895ef70..17fe0ce98af930ceaed3a461ec301b8de5a15db0 100644
(file)
--- a/
source/lib/ejs/ejsParser.c
+++ b/
source/lib/ejs/ejsParser.c
@@
-1128,6
+1128,13
@@
static int parseFunctionDec(Ejs *ep, int state, int flags)
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.