From 4baf09c4beeda6101018982542076beb41ae9625 Mon Sep 17 00:00:00 2001
From: rswindell <>
Date: Tue, 5 Jun 2001 02:40:28 +0000
Subject: [PATCH] Added exit() and sleep() global methods.

---
 src/sbbs3/globobj.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/sbbs3/globobj.c b/src/sbbs3/globobj.c
index d3e6418732..1ddfbd821d 100644
--- a/src/sbbs3/globobj.c
+++ b/src/sbbs3/globobj.c
@@ -140,6 +140,12 @@ js_beep(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
 	return(JS_TRUE);
 }
 
+static JSBool
+js_exit(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
+{
+	return(JS_FALSE);
+}
+
 static JSClass js_global_class ={
         "Global",
 		JSCLASS_HAS_PRIVATE, /* needed for scfg_t ptr */
@@ -148,9 +154,11 @@ static JSClass js_global_class ={
     }; 
 
 static JSFunctionSpec js_global_functions[] = {
+	{"exit",			js_exit,			0},		/* stop execution */
 	{"load",            js_load,            1},		/* Load and execute a javascript file */
 	{"format",			js_format,			1},		/* return a formatted string (ala printf) */
 	{"mswait",			js_mswait,			0},		/* millisecond wait/sleep routine */
+	{"sleep",			js_mswait,			0},		/* millisecond wait/sleep routine */
 	{"beep",			js_beep,			0},		/* local beep (freq, dur) */
 	{0}
 };
-- 
GitLab