From 68a70da260fa41d335b126f3965f408dfd0865cc Mon Sep 17 00:00:00 2001
From: deuce <>
Date: Fri, 11 Jan 2008 22:24:30 +0000
Subject: [PATCH] Don't use INT_TO_JSVAL() in LAZY_*() macros

---
 src/sbbs3/js_msgbase.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/sbbs3/js_msgbase.c b/src/sbbs3/js_msgbase.c
index c278dc2ac1..7b9f7dfd62 100644
--- a/src/sbbs3/js_msgbase.c
+++ b/src/sbbs3/js_msgbase.c
@@ -630,14 +630,16 @@ js_get_msg_index(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r
 
 #define LAZY_INTEGER(PropName, PropValue) \
 	if(name==NULL || strcmp(name, (PropName))==0) { \
-		JS_DefineProperty(cx, obj, (PropName), INT_TO_JSVAL(PropValue), NULL,NULL,JSPROP_ENUMERATE); \
+		JS_NewNumberValue(cx,(PropValue),&v); \
+		JS_DefineProperty(cx, obj, (PropName), v, NULL,NULL,JSPROP_ENUMERATE); \
 		if(name) return(JS_TRUE); \
 	}
 
 #define LAZY_INTEGER_EXPAND(PropName, PropValue) \
 	if(name==NULL || strcmp(name, (PropName))==0) { \
 		if(p->expand_fields || (PropValue)) { \
-			JS_DefineProperty(cx, obj, (PropName), INT_TO_JSVAL(PropValue), NULL,NULL,JSPROP_ENUMERATE); \
+			JS_NewNumberValue(cx,(PropValue),&v); \
+			JS_DefineProperty(cx, obj, (PropName), v, NULL,NULL,JSPROP_ENUMERATE); \
 			if(name) return(JS_TRUE); \
 		} \
 		else if(name) return(JS_TRUE); \
@@ -646,7 +648,8 @@ js_get_msg_index(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r
 #define LAZY_INTEGER_COND(PropName, Condition, PropValue) \
 	if(name==NULL || strcmp(name, (PropName))==0) { \
 		if(Condition) { \
-			JS_DefineProperty(cx, obj, (PropName), INT_TO_JSVAL(PropValue), NULL,NULL,JSPROP_ENUMERATE); \
+			JS_NewNumberValue(cx,(PropValue),&v); \
+			JS_DefineProperty(cx, obj, (PropName), v, NULL,NULL,JSPROP_ENUMERATE); \
 			if(name) return(JS_TRUE); \
 		} \
 		else if(name) return(JS_TRUE); \
-- 
GitLab