diff options
-rw-r--r-- | source4/lib/appweb/ejs/ejsParser.c | 15 | ||||
-rw-r--r-- | source4/lib/appweb/esp/esp.h | 2 |
2 files changed, 5 insertions, 12 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; diff --git a/source4/lib/appweb/esp/esp.h b/source4/lib/appweb/esp/esp.h index e15daf0b4e..39dc5310c2 100644 --- a/source4/lib/appweb/esp/esp.h +++ b/source4/lib/appweb/esp/esp.h @@ -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 |