[gjs/wip/xulrunner-1.9.3: 1/5] xulrunner 1.9.3: Remove callers of JS_NewDoubleValue



commit c440fdb8f1e1dc7e82821790404cde167bedb0bc
Author: Colin Walters <walters verbum org>
Date:   Thu Sep 16 14:54:55 2010 -0400

    xulrunner 1.9.3: Remove callers of JS_NewDoubleValue
    
    This function isn't intended for normal numeric conversions: see
    https://developer.mozilla.org/en/JS_NewNumberValue

 gi/arg.c              |    4 ++--
 gjs/byteArray.c       |    2 +-
 modules/dbus-values.c |    2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/gi/arg.c b/gi/arg.c
index c91199e..c17a2b9 100644
--- a/gi/arg.c
+++ b/gi/arg.c
@@ -1642,10 +1642,10 @@ gjs_value_from_g_argument (JSContext  *context,
         return JS_NewNumberValue(context, arg->v_int8, value_p);
 
     case GI_TYPE_TAG_FLOAT:
-        return JS_NewDoubleValue(context, arg->v_float, value_p);
+        return JS_NewNumberValue(context, arg->v_float, value_p);
 
     case GI_TYPE_TAG_DOUBLE:
-        return JS_NewDoubleValue(context, arg->v_double, value_p);
+        return JS_NewNumberValue(context, arg->v_double, value_p);
 
     case GI_TYPE_TAG_FILENAME:
         if (arg->v_pointer)
diff --git a/gjs/byteArray.c b/gjs/byteArray.c
index 13ef2f3..d0157e9 100644
--- a/gjs/byteArray.c
+++ b/gjs/byteArray.c
@@ -98,7 +98,7 @@ gjs_value_from_gsize(JSContext         *context,
         *value_p = INT_TO_JSVAL(v);
         return JS_TRUE;
     } else {
-        return JS_NewDoubleValue(context, v, value_p);
+        return JS_NewNumberValue(context, v, value_p);
     }
 }
 
diff --git a/modules/dbus-values.c b/modules/dbus-values.c
index 1dae132..0ec22f2 100644
--- a/modules/dbus-values.c
+++ b/modules/dbus-values.c
@@ -257,7 +257,7 @@ gjs_js_one_value_from_dbus(JSContext       *context,
         {
             double v_DOUBLE;
             dbus_message_iter_get_basic(iter, &v_DOUBLE);
-            if (!JS_NewDoubleValue(context, v_DOUBLE, value_p))
+            if (!JS_NewNumberValue(context, v_DOUBLE, value_p))
                 return JS_FALSE;
         }
         break;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]