Skip to content
Snippets Groups Projects
Commit b05908eb authored by rswindell's avatar rswindell
Browse files

Now clears pending exceptions before compiling script.

parent 3bc8b6a6
No related branches found
No related tags found
No related merge requests found
......@@ -633,6 +633,8 @@ long sbbs_t::js_execfile(const char *cmd)
JS_DefineProperty(js_cx, js_scope, "argc", INT_TO_JSVAL(argc)
,NULL,NULL,JSPROP_READONLY|JSPROP_ENUMERATE);
JS_ClearPendingException(js_cx);
js_script=JS_CompileFile(js_cx, js_scope, path);
}
......
......@@ -974,7 +974,10 @@ BOOL js_generate_index(JSContext* js_cx, JSObject* parent,
globfree(&g);
}
/* RUN SCRIPT */
JS_ClearPendingException(js_cx);
if((js_script=JS_CompileFile(js_cx, parent, spath))==NULL) {
lprintf("%04d !JavaScript FAILED to compile script (%s)",sock,spath);
break;
......
......@@ -853,6 +853,8 @@ static void js_service_thread(void* arg)
JS_SetProperty(js_cx, js_glob, "datagram", &val);
FREE_AND_NULL(service_client.udp_buf);
JS_ClearPendingException(js_cx);
js_script=JS_CompileFile(js_cx, js_glob, spath);
if(js_script==NULL)
......@@ -938,6 +940,8 @@ static void js_static_service_thread(void* arg)
val = BOOLEAN_TO_JSVAL(JS_FALSE);
JS_SetProperty(js_cx, js_glob, "logged_in", &val);
JS_ClearPendingException(js_cx);
js_script=JS_CompileFile(js_cx, js_glob, spath);
if(js_script==NULL)
......
......@@ -2004,6 +2004,8 @@ static void respond(http_session_t * session)
do {
/* RUN SCRIPT */
JS_ClearPendingException(session->js_cx);
if((js_script=JS_CompileFile(session->js_cx, session->js_glob
,session->req.physical_path))==NULL) {
lprintf("%04d !JavaScript FAILED to compile script (%s)"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment