From 8435fbc4afe66848ff6732d653dc6e7b692fb622 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 11 Jul 2005 23:16:50 +0000 Subject: r8334: fixed a ejs bug that prevented functions variables from being called in local context (This used to be commit 5ea7ae70813f615769aff7640cc19005e30ecf12) --- source4/lib/ejs/ejsParser.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'source4') diff --git a/source4/lib/ejs/ejsParser.c b/source4/lib/ejs/ejsParser.c index a5c40e593d..772ed574c5 100644 --- a/source4/lib/ejs/ejsParser.c +++ b/source4/lib/ejs/ejsParser.c @@ -1280,10 +1280,6 @@ 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) { - ejsError(ep, "Function name not defined \"%s\"\n", *id); - return -1; - } ejsLexPutbackToken(ep, EJS_TOK_FUNCTION_NAME, ep->token); return state; } @@ -1979,6 +1975,11 @@ 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. */ -- cgit