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

Created global reset_loop() method to defeat infinite-loop detection mechanism.

print() is now an alias for writeln().
parent 5bb307d1
No related branches found
No related tags found
No related merge requests found
......@@ -445,12 +445,27 @@ js_logout(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
return(JS_TRUE);
}
static JSBool
js_reset_loop(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
{
service_client_t* client;
if((client=(service_client_t*)JS_GetContextPrivate(cx))==NULL)
return(JS_FALSE);
client->js_loop=0;
*rval = JSVAL_VOID;
return(JS_TRUE);
}
static JSFunctionSpec js_global_functions[] = {
{"write", js_write, 1}, /* write to client socket */
{"writeln", js_writeln, 1}, /* write line to client socket */
{"log", js_log, 1}, /* Log a string */
{"write", js_write, 0}, /* write to client socket */
{"writeln", js_writeln, 0}, /* write line to client socket */
{"print", js_writeln, 0}, /* write line to client socket */
{"log", js_log, 0}, /* Log a string */
{"login", js_login, 2}, /* Login specified username and password */
{"logout", js_logout, 0}, /* Logout user */
{"reset_loop", js_reset_loop, 0}, /* reset loop counter */
{0}
};
......
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