From 38e556ae25a35f48840f21ead5585b1fd0913b9a Mon Sep 17 00:00:00 2001
From: rswindell <>
Date: Wed, 4 Sep 2002 09:19:09 +0000
Subject: [PATCH] jsMethodSpec now supports a single method alias (rather than
 an array).

---
 src/sbbs3/js_bbs.cpp  |  4 +---
 src/sbbs3/js_socket.c | 11 ++++-------
 2 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/src/sbbs3/js_bbs.cpp b/src/sbbs3/js_bbs.cpp
index aadf0baa02..c542b9fae5 100644
--- a/src/sbbs3/js_bbs.cpp
+++ b/src/sbbs3/js_bbs.cpp
@@ -2348,8 +2348,6 @@ js_getnstime(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
 	return(JS_TRUE);
 }
 
-static const char* nodesync_aliases[] = { "node_sync", NULL };
-
 static jsMethodSpec js_bbs_functions[] = {
 	{"atcode",			js_atcode,			1,	JSTYPE_STRING,		"string code"
 	,"return @-code value"
@@ -2388,7 +2386,7 @@ static jsMethodSpec js_bbs_functions[] = {
 	},
 	{"nodesync",		js_nodesync,		0,	JSTYPE_VOID,	""
 	,"synchronize node with system"
-	, nodesync_aliases
+	,"node_sync"
 	},
 	{"auto_msg",		js_automsg,			0,	JSTYPE_VOID,	""
 	,"edit/create auto-message"
diff --git a/src/sbbs3/js_socket.c b/src/sbbs3/js_socket.c
index 47892ca5d1..b6ed8341e4 100644
--- a/src/sbbs3/js_socket.c
+++ b/src/sbbs3/js_socket.c
@@ -957,10 +957,6 @@ static JSClass js_socket_class = {
 	,js_finalize_socket		/* finalize		*/
 };
 
-static const char* send_aliases[] = { "write"	,NULL };
-static const char* recv_aliases[] = { "read"	,NULL };
-static const char* recvline_aliases[] = { "readline", "readln"	,NULL };
-
 static jsMethodSpec js_socket_functions[] = {
 	{"close",		js_close,		0,	JSTYPE_VOID,		""					
 	,"close socket"		
@@ -978,7 +974,8 @@ static jsMethodSpec js_socket_functions[] = {
 	,"accept an incoming connection, returns a new Socket object"
 	},
 	{"send",		js_send,		1,	JSTYPE_BOOLEAN,	"string data"		
-	,"send a string"					,send_aliases
+	,"send a string"					
+	,"write"
 	},
 	{"sendto",		js_sendto,		3,	JSTYPE_BOOLEAN,	"string data, address, port"
 	,"send a string to a specific address and port (typically used for UDP sockets)"	
@@ -988,14 +985,14 @@ static jsMethodSpec js_socket_functions[] = {
 	},
 	{"recv",		js_recv,		0,	JSTYPE_STRING,	"[maxlen]"			
 	,"receive a string, default maxlen is 512 characters"	
-	, recv_aliases 
+	,"read"
 	},
 	{"peek",		js_peek,		0,	JSTYPE_STRING,	"[maxlen]"			
 	,"receive a string, default maxlen is 512 characters, leave string in receive buffer"
 	},
 	{"recvline",	js_recvline,	0,	JSTYPE_STRING,	"[maxlen] [,timeout]"
 	,"receive a line-feed terminated string, default maxlen is 512 characters, default timeout is 30 seconds"
-	, recvline_aliases 
+	,"readline"
 	},
 	{"recvfrom",	js_recvfrom,	0,	JSTYPE_OBJECT,	"[maxlen]"			
 	,"receive a string from (typically UDP) socket, return address and port of sender"
-- 
GitLab