summaryrefslogtreecommitdiff
path: root/source4/lib/appweb/ejs/ejsParser.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-07-19 00:40:52 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:29:38 -0500
commit2d92eca39316a9edb17a1ffee0087f7365453471 (patch)
tree8c16d2c45998b0aaefec04a509f7c880cbd5ef73 /source4/lib/appweb/ejs/ejsParser.c
parentf1245d4ac1f06988dc4501c14c0e8161be8028aa (diff)
downloadsamba-2d92eca39316a9edb17a1ffee0087f7365453471.tar.gz
samba-2d92eca39316a9edb17a1ffee0087f7365453471.tar.bz2
samba-2d92eca39316a9edb17a1ffee0087f7365453471.zip
r8562: small merge with upstream
(This used to be commit 6c9bf162afddda4747ef08b56598aaf0747a4d27)
Diffstat (limited to 'source4/lib/appweb/ejs/ejsParser.c')
-rw-r--r--source4/lib/appweb/ejs/ejsParser.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/source4/lib/appweb/ejs/ejsParser.c b/source4/lib/appweb/ejs/ejsParser.c
index 772ed574c5..452e7fde8f 100644
--- a/source4/lib/appweb/ejs/ejsParser.c
+++ b/source4/lib/appweb/ejs/ejsParser.c
@@ -1280,6 +1280,10 @@ static int parseId(Ejs *ep, int state, int flags, char **id, char **fullName,
tid = ejsLexGetToken(ep, state);
if (tid == EJS_TOK_LPAREN) {
+ if (ep->currentProperty == 0 && (flags & EJS_FLAGS_EXE)) {
+ ejsError(ep, "Function name not defined \"%s\"\n", *id);
+ return -1;
+ }
ejsLexPutbackToken(ep, EJS_TOK_FUNCTION_NAME, ep->token);
return state;
}
@@ -1975,11 +1979,6 @@ static int evalFunction(Ejs *ep, MprVar *obj, int flags)
actualArgs = proc->args;
argValues = (MprVar**) actualArgs->handles;
- if (prototype == NULL) {
- ejsError(ep, "Function name not defined '%s'\n", proc->procName);
- return -1;
- }
-
/*
* Create a new variable stack frame. ie. new local variables.
*/
@@ -2179,7 +2178,6 @@ int ejsRunFunction(int eid, MprVar *obj, const char *functionName,
MprVar *ejsFindObj(Ejs *ep, int state, const char *property, int flags)
{
- MprVar *vp;
MprVar *obj;
mprAssert(ep);
@@ -2193,10 +2191,7 @@ MprVar *ejsFindObj(Ejs *ep, int state, const char *property, int flags)
} else {
/* First look local, then look global */
- vp = mprGetProperty(ep->local, property, 0);
- if (vp) {
- obj = ep->local;
- } else if (mprGetProperty(ep->local, property, 0)) {
+ if (mprGetProperty(ep->local, property, 0)) {
obj = ep->local;
} else {
obj = ep->global;