r8562: small merge with upstream
authorAndrew Tridgell <tridge@samba.org>
Tue, 19 Jul 2005 00:40:52 +0000 (00:40 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:29:38 +0000 (13:29 -0500)
(This used to be commit 6c9bf162afddda4747ef08b56598aaf0747a4d27)

source4/lib/appweb/ejs/ejsParser.c
source4/lib/appweb/esp/esp.h

index 772ed574c5e401c5d0949d7d212d74ae4c2a64be..452e7fde8f376b671fbf6c8b19470181c3c740dc 100644 (file)
@@ -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;
index e15daf0b4e048e6f9ef0d2e20450153fb344be41..39dc5310c21eff5938dfaf5f156e89df6835fb8c 100644 (file)
@@ -43,8 +43,6 @@
 
 /*********************************** Defines **********************************/
 
-#define ESP_STRING_ARGS                MPR_TYPE_STRING_ARGS
-
 #if BLD_FEATURE_SQUEEZE
 #define ESP_TOK_INCR                   1024
 #define ESP_MAX_HEADER                         1024