[gjs/wip/ptomato/mozjs31prep: 7/8] js: Discontinue usage of JSBool



commit eafa324d5f09cf5a10ace9f1715a079087e166b3
Author: Philip Chimento <philip endlessm com>
Date:   Thu Sep 1 18:41:38 2016 -0700

    js: Discontinue usage of JSBool
    
    In mozjs31, JSBool and its values JS_TRUE and JS_FALSE are discontinued
    in favor of regular C++ bool, true, and false. In order to ease porting
    to mozjs31, we switch to C++ booleans everywhere.
    
    Almost everywhere, that is. In some cases bool *, or function pointers
    with bool return types, will not automatically be cast. We therefore leave
    a few instances of JSBool in the code. These will be removed when the
    actual port to mozjs31 happens.
    
    Fixes a few formatting glitches in lines of code that were touched
    anyway.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=742249

 gi/arg.cpp                        |  321 ++++++++++++++++++-------------------
 gi/arg.h                          |  116 +++++++-------
 gi/boxed.cpp                      |  114 +++++++-------
 gi/boxed.h                        |    4 +-
 gi/enumeration.cpp                |   24 ++--
 gi/enumeration.h                  |   10 +-
 gi/foreign.cpp                    |   46 +++---
 gi/foreign.h                      |   64 ++++----
 gi/function.cpp                   |   89 +++++------
 gi/function.h                     |    4 +-
 gi/fundamental.cpp                |   54 +++---
 gi/fundamental.h                  |   10 +-
 gi/gerror.cpp                     |   64 ++++----
 gi/gerror.h                       |    4 +-
 gi/gtype.cpp                      |   12 +-
 gi/gtype.h                        |    6 +-
 gi/interface.cpp                  |   26 ++--
 gi/interface.h                    |   16 +-
 gi/ns.cpp                         |   20 ++--
 gi/object.cpp                     |  212 ++++++++++++------------
 gi/object.h                       |   12 +-
 gi/param.cpp                      |   26 ++--
 gi/param.h                        |    4 +-
 gi/proxyutils.cpp                 |    6 +-
 gi/proxyutils.h                   |   14 +-
 gi/repo.cpp                       |   48 +++---
 gi/repo.h                         |    4 +-
 gi/union.cpp                      |   40 +++---
 gi/union.h                        |    6 +-
 gi/value.cpp                      |  132 ++++++++--------
 gi/value.h                        |    6 +-
 gjs/byteArray.cpp                 |  132 ++++++++--------
 gjs/byteArray.h                   |    6 +-
 gjs/compat.h                      |    2 +-
 gjs/context.cpp                   |   24 ++--
 gjs/coverage.cpp                  |   31 ++--
 gjs/gi.cpp                        |    2 +-
 gjs/gi.h                          |    4 +-
 gjs/importer.cpp                  |  123 +++++++-------
 gjs/importer.h                    |    6 +-
 gjs/jsapi-dynamic-class.cpp       |   14 +-
 gjs/jsapi-util-error.cpp          |    6 +-
 gjs/jsapi-util-string.cpp         |   34 ++--
 gjs/jsapi-util.cpp                |   86 +++++-----
 gjs/jsapi-util.h                  |   84 +++++-----
 gjs/native.cpp                    |    4 +-
 gjs/native.h                      |   10 +-
 gjs/runtime.cpp                   |   24 ++--
 gjs/runtime.h                     |    2 +-
 gjs/stack.cpp                     |    6 +-
 modules/cairo-context.cpp         |  200 ++++++++++++------------
 modules/cairo-gradient.cpp        |   16 +-
 modules/cairo-image-surface.cpp   |   48 +++---
 modules/cairo-linear-gradient.cpp |    6 +-
 modules/cairo-module.h            |    4 +-
 modules/cairo-pattern.cpp         |    8 +-
 modules/cairo-pdf-surface.cpp     |    6 +-
 modules/cairo-private.h           |    2 +-
 modules/cairo-ps-surface.cpp      |    6 +-
 modules/cairo-radial-gradient.cpp |    6 +-
 modules/cairo-region.cpp          |   60 ++++----
 modules/cairo-solid-pattern.cpp   |   16 +-
 modules/cairo-surface-pattern.cpp |   40 +++---
 modules/cairo-surface.cpp         |   34 ++--
 modules/cairo-svg-surface.cpp     |    6 +-
 modules/cairo.cpp                 |   36 ++--
 modules/console.cpp               |   24 ++--
 modules/console.h                 |   10 +-
 modules/system.cpp                |   39 +++---
 modules/system.h                  |    4 +-
 test/gjs-tests.cpp                |    4 +-
 71 files changed, 1337 insertions(+), 1352 deletions(-)
---
diff --git a/gi/arg.cpp b/gi/arg.cpp
index 9dd30f5..72d26f3 100644
--- a/gi/arg.cpp
+++ b/gi/arg.cpp
@@ -40,7 +40,7 @@
 
 #include <util/log.h>
 
-JSBool
+bool
 _gjs_flags_value_is_valid(JSContext   *context,
                           GType        gtype,
                           gint64       value)
@@ -51,7 +51,7 @@ _gjs_flags_value_is_valid(JSContext   *context,
 
     /* FIXME: Do proper value check for flags with GType's */
     if (gtype == G_TYPE_NONE)
-        return JS_TRUE;
+        return true;
 
     klass = g_type_class_ref(gtype);
 
@@ -61,7 +61,7 @@ _gjs_flags_value_is_valid(JSContext   *context,
         gjs_throw(context,
                   "0x%" G_GINT64_MODIFIER "x is not a valid value for flags %s",
                   value, g_type_name(G_TYPE_FROM_CLASS(klass)));
-        return JS_FALSE;
+        return false;
     }
 
     while (tmpval) {
@@ -70,27 +70,27 @@ _gjs_flags_value_is_valid(JSContext   *context,
             gjs_throw(context,
                       "0x%x is not a valid value for flags %s",
                       (guint32)value, g_type_name(G_TYPE_FROM_CLASS(klass)));
-            return JS_FALSE;
+            return false;
         }
 
         tmpval &= ~v->value;
     }
     g_type_class_unref(klass);
 
-    return JS_TRUE;
+    return true;
 }
 
-JSBool
+bool
 _gjs_enum_value_is_valid(JSContext  *context,
                          GIEnumInfo *enum_info,
                          gint64      value)
 {
-    JSBool found;
+    bool found;
     int n_values;
     int i;
 
     n_values = g_enum_info_get_n_values(enum_info);
-    found = JS_FALSE;
+    found = false;
 
     for (i = 0; i < n_values; ++i) {
         GIValueInfo *value_info;
@@ -101,7 +101,7 @@ _gjs_enum_value_is_valid(JSContext  *context,
         g_base_info_unref((GIBaseInfo *)value_info);
 
         if (enum_value == value) {
-            found = JS_TRUE;
+            found = true;
             break;
         }
     }
@@ -226,7 +226,7 @@ type_needs_release (GITypeInfo *type_info,
 /* Check if an argument of the given needs to be released if we obtained it
  * from out argument (or the return value), and we're transferring ownership
  */
-static JSBool
+static bool
 type_needs_out_release(GITypeInfo *type_info,
                        GITypeTag   type_tag)
 {
@@ -273,7 +273,7 @@ type_needs_out_release(GITypeInfo *type_info,
     }
 }
 
-static JSBool
+static bool
 gjs_array_to_g_list(JSContext   *context,
                     JS::Value    array_value,
                     unsigned int length,
@@ -299,7 +299,7 @@ gjs_array_to_g_list(JSContext   *context,
              */
             gjs_throw(context,
                       "Container transfer for in parameters not supported");
-            return JS_FALSE;
+            return false;
         }
 
         transfer = GI_TRANSFER_NOTHING;
@@ -313,7 +313,7 @@ gjs_array_to_g_list(JSContext   *context,
             gjs_throw(context,
                       "Missing array element %u",
                       i);
-            return JS_FALSE;
+            return false;
         }
 
         /* FIXME we don't know if the list elements can be NULL.
@@ -328,7 +328,7 @@ gjs_array_to_g_list(JSContext   *context,
                                      transfer,
                                      FALSE,
                                      &elem_arg)) {
-            return JS_FALSE;
+            return false;
         }
 
         if (list_type == GI_TYPE_TAG_GLIST) {
@@ -346,10 +346,10 @@ gjs_array_to_g_list(JSContext   *context,
     *list_p = list;
     *slist_p = slist;
 
-    return JS_TRUE;
+    return true;
 }
 
-static JSBool
+static bool
 gjs_object_to_g_hash(JSContext   *context,
                      JS::Value    hash_value,
                      GITypeInfo  *key_param_info,
@@ -374,7 +374,7 @@ gjs_object_to_g_hash(JSContext   *context,
              */
             gjs_throw(context,
                       "Container transfer for in parameters not supported");
-            return JS_FALSE;
+            return false;
         }
 
         transfer = GI_TRANSFER_NOTHING;
@@ -382,11 +382,11 @@ gjs_object_to_g_hash(JSContext   *context,
 
     iter = JS_NewPropertyIterator(context, props);
     if (iter == NULL)
-        return JS_FALSE;
+        return false;
 
     prop_id = JSID_VOID;
     if (!JS_NextProperty(context, iter, &prop_id))
-        return JS_FALSE;
+        return false;
 
     /* Don't use key/value destructor functions here, because we can't
      * construct correct ones in general if the value type is complex.
@@ -427,14 +427,14 @@ gjs_object_to_g_hash(JSContext   *context,
     }
 
     *hash_p = result;
-    return JS_TRUE;
+    return true;
 
  free_hash_and_fail:
     g_hash_table_destroy(result);
-    return JS_FALSE;
+    return false;
 }
 
-JSBool
+bool
 gjs_array_from_strv(JSContext   *context,
                     JS::Value   *value_p,
                     const char **strv)
@@ -442,11 +442,11 @@ gjs_array_from_strv(JSContext   *context,
     JSObject *obj;
     JS::Value elem;
     guint i;
-    JSBool result = JS_FALSE;
+    bool result = false;
 
     obj = JS_NewArrayObject(context, 0, NULL);
     if (obj == NULL)
-        return JS_FALSE;
+        return false;
 
     *value_p = JS::ObjectValue(*obj);
 
@@ -463,7 +463,7 @@ gjs_array_from_strv(JSContext   *context,
         }
     }
 
-    result = JS_TRUE;
+    result = true;
 
 out:
     JS_RemoveValueRoot(context, &elem);
@@ -471,7 +471,7 @@ out:
     return result;
 }
 
-JSBool
+bool
 gjs_array_to_strv(JSContext   *context,
                   JS::Value    array_value,
                   unsigned int length,
@@ -491,27 +491,27 @@ gjs_array_to_strv(JSContext   *context,
             gjs_throw(context,
                       "Missing array element %u",
                       i);
-            return JS_FALSE;
+            return false;
         }
 
         if (!elem.isString()) {
             gjs_throw(context,
                       "Invalid element in string array");
             g_strfreev(result);
-            return JS_FALSE;
+            return false;
         }
         if (!gjs_string_to_utf8(context, elem, (char **)&(result[i]))) {
             g_strfreev(result);
-            return JS_FALSE;
+            return false;
         }
     }
 
     *arr_p = result;
 
-    return JS_TRUE;
+    return true;
 }
 
-static JSBool
+static bool
 gjs_string_to_intarray(JSContext   *context,
                        JS::Value    string_val,
                        GITypeInfo  *param_info,
@@ -528,28 +528,28 @@ gjs_string_to_intarray(JSContext   *context,
     case GI_TYPE_TAG_INT8:
     case GI_TYPE_TAG_UINT8:
         if (!gjs_string_to_utf8(context, string_val, &result))
-            return JS_FALSE;
+            return false;
         *arr_p = result;
         *length = strlen(result);
-        return JS_TRUE;
+        return true;
 
     case GI_TYPE_TAG_INT16:
     case GI_TYPE_TAG_UINT16:
         if (!gjs_string_get_uint16_data(context, string_val,
                                         &result16, length))
-            return JS_FALSE;
+            return false;
         *arr_p = result16;
-        return JS_TRUE;
+        return true;
 
     default:
         /* can't convert a string to this type */
         gjs_throw(context, "Cannot convert string to array of '%s'",
                   g_type_tag_to_string (element_type));
-        return JS_FALSE;
+        return false;
     }
 }
 
-static JSBool
+static bool
 gjs_array_to_intarray(JSContext   *context,
                       JS::Value    array_value,
                       unsigned int length,
@@ -567,7 +567,7 @@ gjs_array_to_intarray(JSContext   *context,
 
     for (i = 0; i < length; ++i) {
         JS::Value elem;
-        JSBool success;
+        bool success;
 
         elem = JS::UndefinedValue();
         if (!JS_GetElement(context, array_value.toObjectOrNull(), i, &elem)) {
@@ -575,7 +575,7 @@ gjs_array_to_intarray(JSContext   *context,
             gjs_throw(context,
                       "Missing array element %u",
                       i);
-            return JS_FALSE;
+            return false;
         }
 
         /* do whatever sign extension is appropriate */
@@ -587,7 +587,7 @@ gjs_array_to_intarray(JSContext   *context,
             g_free(result);
             gjs_throw(context,
                       "Invalid element in int array");
-            return JS_FALSE;
+            return false;
         }
         /* Note that this is truncating assignment. */
         switch (intsize) {
@@ -604,10 +604,10 @@ gjs_array_to_intarray(JSContext   *context,
 
     *arr_p = result;
 
-    return JS_TRUE;
+    return true;
 }
 
-static JSBool
+static bool
 gjs_gtypearray_to_array(JSContext   *context,
                         JS::Value    array_value,
                         unsigned int length,
@@ -627,7 +627,7 @@ gjs_gtypearray_to_array(JSContext   *context,
         if (!JS_GetElement(context, array_value.toObjectOrNull(), i, &elem)) {
             g_free(result);
             gjs_throw(context, "Missing array element %u", i);
-            return JS_FALSE;
+            return false;
         }
 
         if (!elem.isObjectOrNull())
@@ -642,15 +642,15 @@ gjs_gtypearray_to_array(JSContext   *context,
 
     *arr_p = result;
 
-    return JS_TRUE;
+    return true;
 
  err:
     g_free(result);
     gjs_throw(context, "Invalid element in GType array");
-    return JS_FALSE;
+    return false;
 }
 
-static JSBool
+static bool
 gjs_array_to_floatarray(JSContext   *context,
                         JS::Value    array_value,
                         unsigned int length,
@@ -666,7 +666,7 @@ gjs_array_to_floatarray(JSContext   *context,
     for (i = 0; i < length; ++i) {
         JS::Value elem;
         double val;
-        JSBool success;
+        bool success;
 
         elem = JS::UndefinedValue();
         if (!JS_GetElement(context, array_value.toObjectOrNull(), i, &elem)) {
@@ -674,7 +674,7 @@ gjs_array_to_floatarray(JSContext   *context,
             gjs_throw(context,
                       "Missing array element %u",
                       i);
-            return JS_FALSE;
+            return false;
         }
 
         /* do whatever sign extension is appropriate */
@@ -684,7 +684,7 @@ gjs_array_to_floatarray(JSContext   *context,
             g_free(result);
             gjs_throw(context,
                       "Invalid element in array");
-            return JS_FALSE;
+            return false;
         }
 
         /* Note that this is truncating assignment. */
@@ -699,10 +699,10 @@ gjs_array_to_floatarray(JSContext   *context,
 
     *arr_p = result;
 
-    return JS_TRUE;
+    return true;
 }
 
-static JSBool
+static bool
 gjs_array_to_ptrarray(JSContext   *context,
                       JS::Value    array_value,
                       unsigned int length,
@@ -721,7 +721,7 @@ gjs_array_to_ptrarray(JSContext   *context,
         GIArgument arg;
         arg.v_pointer = NULL;
 
-        JSBool success;
+        bool success;
 
         elem = JS::UndefinedValue();
         if (!JS_GetElement(context, array_value.toObjectOrNull(), i, &elem)) {
@@ -729,7 +729,7 @@ gjs_array_to_ptrarray(JSContext   *context,
             gjs_throw(context,
                       "Missing array element %u",
                       i);
-            return JS_FALSE;
+            return false;
         }
 
         success = gjs_value_to_g_argument (context,
@@ -745,17 +745,17 @@ gjs_array_to_ptrarray(JSContext   *context,
             g_free(array);
             gjs_throw(context,
                       "Invalid element in array");
-            return JS_FALSE;
+            return false;
         }
 
         array[i] = arg.v_pointer;
     }
 
     *arr_p = array;
-    return JS_TRUE;
+    return true;
 }
 
-static JSBool
+static bool
 gjs_array_to_flat_gvalue_array(JSContext   *context,
                                JS::Value    array_value,
                                unsigned int length,
@@ -763,7 +763,7 @@ gjs_array_to_flat_gvalue_array(JSContext   *context,
 {
     GValue *values = g_new0(GValue, length);
     unsigned int i;
-    JSBool result = JS_TRUE;
+    bool result = true;
 
     for (i = 0; i < length; i ++) {
         JS::Value elem;
@@ -774,7 +774,7 @@ gjs_array_to_flat_gvalue_array(JSContext   *context,
             gjs_throw(context,
                       "Missing array element %u",
                       i);
-            return JS_FALSE;
+            return false;
         }
 
         result = gjs_value_to_g_value(context, elem, &values[i]);
@@ -789,7 +789,7 @@ gjs_array_to_flat_gvalue_array(JSContext   *context,
     return result;
 }
 
-static JSBool
+static bool
 gjs_array_from_flat_gvalue_array(JSContext   *context,
                                  gpointer     array,
                                  unsigned int length,
@@ -798,7 +798,7 @@ gjs_array_from_flat_gvalue_array(JSContext   *context,
     GValue *values = (GValue *)array;
     unsigned int i;
     JS::Value *elems = g_newa(JS::Value, length);
-    JSBool result = JS_TRUE;
+    bool result = true;
 
     for (i = 0; i < length; i ++) {
         GValue *gvalue = &values[i];
@@ -866,7 +866,7 @@ is_gvalue_flat_array(GITypeInfo *param_info,
     return result;
 }
 
-static JSBool
+static bool
 gjs_array_to_array(JSContext   *context,
                    JS::Value    array_value,
                    gsize        length,
@@ -939,7 +939,7 @@ gjs_array_to_array(JSContext   *context,
     default:
         gjs_throw(context,
                   "Unhandled array element type %d", element_type);
-        return JS_FALSE;
+        return false;
     }
 }
 
@@ -1068,7 +1068,7 @@ throw_invalid_argument(JSContext      *context,
     g_free(display_name);
 }
 
-static JSBool
+static bool
 gjs_array_to_explicit_array_internal(JSContext       *context,
                                      JS::Value        value,
                                      GITypeInfo      *type_info,
@@ -1079,7 +1079,7 @@ gjs_array_to_explicit_array_internal(JSContext       *context,
                                      gpointer        *contents,
                                      gsize           *length_p)
 {
-    JSBool ret = JS_FALSE;
+    bool ret = false;
     GITypeInfo *param_info;
     jsid length_name;
     JSBool found_length;
@@ -1129,14 +1129,14 @@ gjs_array_to_explicit_array_internal(JSContext       *context,
         goto out;
     }
 
-    ret = JS_TRUE;
+    ret = true;
  out:
     g_base_info_unref((GIBaseInfo*) param_info);
 
     return ret;
 }
 
-JSBool
+bool
 gjs_value_to_g_argument(JSContext      *context,
                         JS::Value       value,
                         GITypeInfo     *type_info,
@@ -1159,7 +1159,7 @@ gjs_value_to_g_argument(JSContext      *context,
                       g_type_tag_to_string(type_tag));
 
     nullable_type = FALSE;
-    wrong = FALSE; /* return JS_FALSE */
+    wrong = FALSE; /* return false */
     out_of_range = FALSE;
     report_type_mismatch = FALSE; /* wrong=TRUE, and still need to gjs_throw a type problem */
 
@@ -1324,7 +1324,7 @@ gjs_value_to_g_argument(JSContext      *context,
         if (value.isNull()) {
             arg->v_pointer = NULL;
         } else if (value.isObject()) {
-            if (gjs_typecheck_gerror(context, &value.toObject(), JS_TRUE)) {
+            if (gjs_typecheck_gerror(context, &value.toObject(), true)) {
                 arg->v_pointer = gjs_gerror_from_error(context, &value.toObject());
 
                 if (transfer != GI_TRANSFER_NOTHING)
@@ -1362,7 +1362,7 @@ gjs_value_to_g_argument(JSContext      *context,
             switch(interface_type) {
             case GI_INFO_TYPE_STRUCT:
                 if (g_struct_info_is_foreign((GIStructInfo*)interface_info)) {
-                    JSBool ret;
+                    bool ret;
                     ret = gjs_struct_foreign_convert_to_g_argument(
                             context, value, interface_info, arg_name,
                             arg_type, transfer, may_be_null, arg);
@@ -1448,7 +1448,7 @@ gjs_value_to_g_argument(JSContext      *context,
                         && gjs_typecheck_bytearray(context, obj, FALSE)) {
                         arg->v_pointer = gjs_byte_array_get_bytes(context, obj);
                     } else if (g_type_is_a(gtype, G_TYPE_ERROR)) {
-                        if (!gjs_typecheck_gerror(context, &value.toObject(), JS_TRUE)) {
+                        if (!gjs_typecheck_gerror(context, &value.toObject(), true)) {
                             arg->v_pointer = NULL;
                             wrong = TRUE;
                         } else {
@@ -1457,8 +1457,7 @@ gjs_value_to_g_argument(JSContext      *context,
                         }
                     } else {
                         if (!gjs_typecheck_boxed(context, &value.toObject(),
-                                                 interface_info, gtype,
-                                                 JS_TRUE)) {
+                                                 interface_info, gtype, true)) {
                             arg->v_pointer = NULL;
                             wrong = TRUE;
                         } else {
@@ -1482,7 +1481,7 @@ gjs_value_to_g_argument(JSContext      *context,
 
                 } else if (interface_type == GI_INFO_TYPE_UNION) {
                     if (gjs_typecheck_union(context, &value.toObject(),
-                                            interface_info, gtype, JS_TRUE)) {
+                                            interface_info, gtype, true)) {
                         arg->v_pointer = gjs_c_union_from_union(context,
                                                                 &value.toObject());
 
@@ -1504,7 +1503,7 @@ gjs_value_to_g_argument(JSContext      *context,
 
                 } else if (gtype != G_TYPE_NONE) {
                     if (g_type_is_a(gtype, G_TYPE_OBJECT)) {
-                        if (gjs_typecheck_object(context, &value.toObject(), gtype, JS_TRUE)) {
+                        if (gjs_typecheck_object(context, &value.toObject(), gtype, true)) {
                             arg->v_pointer = gjs_g_object_from_object(context,
                                                                       &value.toObject());
 
@@ -1515,7 +1514,7 @@ gjs_value_to_g_argument(JSContext      *context,
                             wrong = TRUE;
                         }
                     } else if (g_type_is_a(gtype, G_TYPE_PARAM)) {
-                        if (gjs_typecheck_param(context, &value.toObject(), gtype, JS_TRUE)) {
+                        if (gjs_typecheck_param(context, &value.toObject(), gtype, true)) {
                             arg->v_pointer = gjs_g_param_from_param(context, &value.toObject());
                             if (transfer != GI_TRANSFER_NOTHING)
                                 g_param_spec_ref(G_PARAM_SPEC(arg->v_pointer));
@@ -1538,7 +1537,7 @@ gjs_value_to_g_argument(JSContext      *context,
                                       interface_type);
                         }
                     } else if (G_TYPE_IS_INSTANTIATABLE(gtype)) {
-                        if (gjs_typecheck_fundamental(context, &value.toObject(), gtype, JS_TRUE)) {
+                        if (gjs_typecheck_fundamental(context, &value.toObject(), gtype, true)) {
                             arg->v_pointer = gjs_g_fundamental_from_object(context,
                                                                            &value.toObject());
 
@@ -1551,19 +1550,19 @@ gjs_value_to_g_argument(JSContext      *context,
                     } else if (G_TYPE_IS_INTERFACE(gtype)) {
                         /* Could be a GObject interface that's missing a prerequisite, or could
                            be a fundamental */
-                        if (gjs_typecheck_object(context, &value.toObject(), gtype, JS_FALSE)) {
+                        if (gjs_typecheck_object(context, &value.toObject(), gtype, false)) {
                             arg->v_pointer = gjs_g_object_from_object(context, &value.toObject());
 
                             if (transfer != GI_TRANSFER_NOTHING)
                                 g_object_ref(arg->v_pointer);
-                        } else if (gjs_typecheck_fundamental(context, &value.toObject(), gtype, JS_FALSE)) {
+                        } else if (gjs_typecheck_fundamental(context, &value.toObject(), gtype, false)) {
                             arg->v_pointer = gjs_g_fundamental_from_object(context, &value.toObject());
 
                             if (transfer != GI_TRANSFER_NOTHING)
                                 gjs_fundamental_ref(context, arg->v_pointer);
                         } else {
                             /* Call again with throw=TRUE to set the exception */
-                            gjs_typecheck_object(context, &value.toObject(), gtype, JS_TRUE);
+                            gjs_typecheck_object(context, &value.toObject(), gtype, true);
                             arg->v_pointer = NULL;
                             wrong = TRUE;
                         }
@@ -1807,14 +1806,14 @@ gjs_value_to_g_argument(JSContext      *context,
         if (report_type_mismatch) {
             throw_invalid_argument(context, value, type_info, arg_name, arg_type);
         }
-        return JS_FALSE;
+        return false;
     } else if (G_UNLIKELY(out_of_range)) {
         gchar *display_name = get_argument_display_name (arg_name, arg_type);
         gjs_throw(context, "value is out of range for %s (type %s)",
                   display_name,
                   g_type_tag_to_string(type_tag));
         g_free (display_name);
-        return JS_FALSE;
+        return false;
     } else if (nullable_type &&
                arg->v_pointer == NULL &&
                !may_be_null) {
@@ -1824,9 +1823,9 @@ gjs_value_to_g_argument(JSContext      *context,
                   display_name,
                   g_type_tag_to_string(type_tag));
         g_free (display_name);
-        return JS_FALSE;
+        return false;
     } else {
-        return JS_TRUE;
+        return true;
     }
 }
 
@@ -1952,7 +1951,7 @@ gjs_g_argument_init_default(JSContext      *context,
     }
 }
 
-JSBool
+bool
 gjs_value_to_arg(JSContext  *context,
                  JS::Value   value,
                  GIArgInfo  *arg_info,
@@ -1972,7 +1971,7 @@ gjs_value_to_arg(JSContext  *context,
                                    arg);
 }
 
-JSBool
+bool
 gjs_value_to_explicit_array (JSContext  *context,
                              JS::Value   value,
                              GIArgInfo  *arg_info,
@@ -1994,7 +1993,7 @@ gjs_value_to_explicit_array (JSContext  *context,
                                                 length_p);
 }
 
-static JSBool
+static bool
 gjs_array_from_g_list (JSContext  *context,
                        JS::Value  *value_p,
                        GITypeTag   list_tag,
@@ -2006,18 +2005,18 @@ gjs_array_from_g_list (JSContext  *context,
     unsigned int i;
     JS::Value elem;
     GArgument arg;
-    JSBool result;
+    bool result;
 
     obj = JS_NewArrayObject(context, 0, NULL);
     if (obj == NULL)
-        return JS_FALSE;
+        return false;
 
     *value_p = JS::ObjectValue(*obj);
 
     elem = JS::UndefinedValue();
     JS_AddValueRoot(context, &elem);
 
-    result = JS_FALSE;
+    result = false;
 
     i = 0;
     if (list_tag == GI_TYPE_TAG_GLIST) {
@@ -2054,7 +2053,7 @@ gjs_array_from_g_list (JSContext  *context,
         }
     }
 
-    result = JS_TRUE;
+    result = true;
 
  out:
     JS_RemoveValueRoot(context, &elem);
@@ -2062,7 +2061,7 @@ gjs_array_from_g_list (JSContext  *context,
     return result;
 }
 
-static JSBool
+static bool
 gjs_array_from_carray_internal (JSContext  *context,
                                 JS::Value  *value_p,
                                 GITypeInfo *param_info,
@@ -2072,11 +2071,11 @@ gjs_array_from_carray_internal (JSContext  *context,
     JSObject *obj;
     JS::Value elem;
     GArgument arg;
-    JSBool result;
+    bool result;
     GITypeTag element_type;
     guint i;
 
-    result = JS_FALSE;
+    result = false;
 
     element_type = g_type_info_get_tag(param_info);
 
@@ -2092,14 +2091,14 @@ gjs_array_from_carray_internal (JSContext  *context,
         
         obj = gjs_byte_array_from_byte_array (context, &gbytearray);
         if (obj == NULL)
-            return JS_FALSE;
+            return false;
         *value_p = JS::ObjectValue(*obj);
-        return JS_TRUE;
+        return true;
     } 
 
     obj = JS_NewArrayObject(context, 0, NULL);
     if (obj == NULL)
-      return JS_FALSE;
+        return false;
 
     *value_p = JS::ObjectValue(*obj);
 
@@ -2196,7 +2195,7 @@ gjs_array_from_carray_internal (JSContext  *context,
 
 #undef ITERATE
 
-    result = JS_TRUE;
+    result = true;
 
 finally:
     JS_RemoveValueRoot(context, &elem);
@@ -2204,7 +2203,7 @@ finally:
     return result;
 }
 
-static JSBool
+static bool
 gjs_array_from_fixed_size_array (JSContext  *context,
                                  JS::Value  *value_p,
                                  GITypeInfo *type_info,
@@ -2212,7 +2211,7 @@ gjs_array_from_fixed_size_array (JSContext  *context,
 {
     gint length;
     GITypeInfo *param_info;
-    JSBool res;
+    bool res;
 
     length = g_type_info_get_array_fixed_size(type_info);
 
@@ -2227,7 +2226,7 @@ gjs_array_from_fixed_size_array (JSContext  *context,
     return res;
 }
 
-JSBool
+bool
 gjs_value_from_explicit_array(JSContext  *context,
                               JS::Value  *value_p,
                               GITypeInfo *type_info,
@@ -2235,7 +2234,7 @@ gjs_value_from_explicit_array(JSContext  *context,
                               int         length)
 {
     GITypeInfo *param_info;
-    JSBool res;
+    bool res;
 
     param_info = g_type_info_get_param_type(type_info, 0);
 
@@ -2246,7 +2245,7 @@ gjs_value_from_explicit_array(JSContext  *context,
     return res;
 }
 
-static JSBool
+static bool
 gjs_array_from_boxed_array (JSContext   *context,
                             JS::Value   *value_p,
                             GIArrayType  array_type,
@@ -2283,7 +2282,7 @@ gjs_array_from_boxed_array (JSContext   *context,
     return gjs_array_from_carray_internal(context, value_p, param_info, length, data);
 }
 
-static JSBool
+static bool
 gjs_array_from_zero_terminated_c_array (JSContext  *context,
                                         JS::Value  *value_p,
                                         GITypeInfo *param_info,
@@ -2292,11 +2291,11 @@ gjs_array_from_zero_terminated_c_array (JSContext  *context,
     JSObject *obj;
     JS::Value elem;
     GArgument arg;
-    JSBool result;
+    bool result;
     GITypeTag element_type;
     guint i;
 
-    result = JS_FALSE;
+    result = false;
 
     element_type = g_type_info_get_tag(param_info);
 
@@ -2309,14 +2308,14 @@ gjs_array_from_zero_terminated_c_array (JSContext  *context,
 
         obj = gjs_byte_array_from_byte_array (context, &gbytearray);
         if (obj == NULL)
-            return JS_FALSE;
+            return false;
         *value_p = JS::ObjectValue(*obj);
-        return JS_TRUE;
+        return true;
     } 
 
     obj = JS_NewArrayObject(context, 0, NULL);
     if (obj == NULL)
-      return JS_FALSE;
+        return false;
 
     *value_p = JS::ObjectValue(*obj);
 
@@ -2383,7 +2382,7 @@ gjs_array_from_zero_terminated_c_array (JSContext  *context,
 
 #undef ITERATE
 
-    result = JS_TRUE;
+    result = true;
 
 finally:
     JS_RemoveValueRoot(context, &elem);
@@ -2392,7 +2391,7 @@ finally:
 }
 
 
-static JSBool
+static bool
 gjs_object_from_g_hash (JSContext  *context,
                         JS::Value  *value_p,
                         GITypeInfo *key_param_info,
@@ -2405,17 +2404,17 @@ gjs_object_from_g_hash (JSContext  *context,
     char     *keyutf8 = NULL;
     JS::Value keyjs, valjs;
     GArgument keyarg, valarg;
-    JSBool result;
+    bool result;
 
     // a NULL hash table becomes a null JS value
     if (hash==NULL) {
         *value_p = JS::NullValue();
-        return JS_TRUE;
+        return true;
     }
 
     obj = JS_NewObject(context, NULL, NULL, NULL);
     if (obj == NULL)
-        return JS_FALSE;
+        return false;
 
     *value_p = JS::ObjectValue(*obj);
     JS_AddObjectRoot(context, &obj);
@@ -2429,7 +2428,7 @@ gjs_object_from_g_hash (JSContext  *context,
     keystr = NULL;
     JS_AddStringRoot(context, &keystr);
 
-    result = JS_FALSE;
+    result = false;
 
     g_hash_table_iter_init(&iter, hash);
     while (g_hash_table_iter_next
@@ -2459,7 +2458,7 @@ gjs_object_from_g_hash (JSContext  *context,
         keyutf8 = NULL;
     }
 
-    result = JS_TRUE;
+    result = true;
 
  out:
     if (keyutf8) g_free(keyutf8);
@@ -2471,7 +2470,7 @@ gjs_object_from_g_hash (JSContext  *context,
     return result;
 }
 
-JSBool
+bool
 gjs_value_from_g_argument (JSContext  *context,
                            JS::Value  *value_p,
                            GITypeInfo *type_info,
@@ -2557,7 +2556,7 @@ gjs_value_from_g_argument (JSContext  *context,
                 gjs_throw(context,
                           "Invalid unicode codepoint %" G_GUINT32_FORMAT,
                           arg->v_uint32);
-                return JS_FALSE;
+                return false;
             } else {
                 bytes = g_unichar_to_utf8 (arg->v_uint32, utf8);
                 return gjs_string_from_utf8 (context, (char*)utf8, bytes, value_p);
@@ -2571,7 +2570,7 @@ gjs_value_from_g_argument (JSContext  *context,
             /* For NULL we'll return JS::NullValue(), which is already set
              * in *value_p
              */
-            return JS_TRUE;
+            return true;
         }
     case GI_TYPE_TAG_UTF8:
         if (arg->v_pointer)
@@ -2580,7 +2579,7 @@ gjs_value_from_g_argument (JSContext  *context,
             /* For NULL we'll return JS::NullValue(), which is already set
              * in *value_p
              */
-            return JS_TRUE;
+            return true;
         }
 
     case GI_TYPE_TAG_ERROR:
@@ -2589,12 +2588,12 @@ gjs_value_from_g_argument (JSContext  *context,
                 JSObject *obj = gjs_error_from_gerror(context, (GError *) arg->v_pointer, FALSE);
                 if (obj) {
                     *value_p = JS::ObjectValue(*obj);
-                    return JS_TRUE;
+                    return true;
                 }
 
-                return JS_FALSE;
+                return false;
             }
-            return JS_TRUE;
+            return true;
         }
 
     case GI_TYPE_TAG_INTERFACE:
@@ -2638,7 +2637,7 @@ gjs_value_from_g_argument (JSContext  *context,
                 goto out;
             } else if (interface_type == GI_INFO_TYPE_STRUCT &&
                        g_struct_info_is_foreign((GIStructInfo*)interface_info)) {
-                JSBool ret;
+                bool ret;
                 ret = gjs_struct_foreign_convert_from_g_argument(context, value_p, interface_info, arg);
                 g_base_info_unref(interface_info);
                 return ret;
@@ -2652,7 +2651,7 @@ gjs_value_from_g_argument (JSContext  *context,
 
             if (interface_type == GI_INFO_TYPE_STRUCT &&
                 g_struct_info_is_gtype_struct((GIStructInfo*)interface_info)) {
-                JSBool ret;
+                bool ret;
 
                 /* XXX: here we make the implicit assumption that GTypeClass is the same
                    as GTypeInterface. This is true for the GType field, which is what we
@@ -2739,7 +2738,7 @@ gjs_value_from_g_argument (JSContext  *context,
                           "Type %s registered for unexpected interface_type %d",
                           g_type_name(gtype),
                           interface_type);
-                return JS_FALSE;
+                return false;
             } else if (g_type_is_a(gtype, G_TYPE_PARAM)) {
                 JSObject *obj;
                 obj = gjs_param_from_g_param(context, G_PARAM_SPEC(arg->v_pointer));
@@ -2761,7 +2760,7 @@ gjs_value_from_g_argument (JSContext  *context,
             g_base_info_unref( (GIBaseInfo*) interface_info);
 
             if (value.isUndefined())
-                return JS_FALSE;
+                return false;
 
             *value_p = value;
         }
@@ -2774,7 +2773,7 @@ gjs_value_from_g_argument (JSContext  *context,
 
             if (g_type_info_is_zero_terminated(type_info)) {
                 GITypeInfo *param_info;
-                JSBool result;
+                bool result;
 
                 param_info = g_type_info_get_param_type(type_info, 0);
                 g_assert(param_info != NULL);
@@ -2798,7 +2797,7 @@ gjs_value_from_g_argument (JSContext  *context,
                                                              (GByteArray*)arg->v_pointer);
             if (!array) {
                 gjs_throw(context, "Couldn't convert GByteArray to a ByteArray");
-                return JS_FALSE;
+                return false;
             }
             *value_p = JS::ObjectValue(*array);
         } else {
@@ -2872,13 +2871,13 @@ gjs_value_from_g_argument (JSContext  *context,
     default:
         g_warning("Unhandled type %s converting GArgument to JavaScript",
                   g_type_tag_to_string(type_tag));
-        return JS_FALSE;
+        return false;
     }
 
-    return JS_TRUE;
+    return true;
 }
 
-static JSBool gjs_g_arg_release_internal(JSContext  *context,
+static bool gjs_g_arg_release_internal(JSContext  *context,
                                          GITransfer  transfer,
                                          GITypeInfo *type_info,
                                          GITypeTag   type_tag,
@@ -2888,7 +2887,7 @@ typedef struct {
     JSContext *context;
     GITypeInfo *key_param_info, *val_param_info;
     GITransfer transfer;
-    JSBool failed;
+    bool failed;
 } GHR_closure;
 
 static gboolean
@@ -2901,13 +2900,13 @@ gjs_ghr_helper(gpointer key, gpointer val, gpointer user_data) {
                                     c->key_param_info,
                                     g_type_info_get_tag(c->key_param_info),
                                     &key_arg))
-        c->failed = JS_TRUE;
+        c->failed = true;
 
     if (!gjs_g_arg_release_internal(c->context, c->transfer,
                                     c->val_param_info,
                                     g_type_info_get_tag(c->val_param_info),
                                     &val_arg))
-        c->failed = JS_TRUE;
+        c->failed = true;
     return TRUE;
 }
 
@@ -2917,18 +2916,18 @@ gjs_ghr_helper(gpointer key, gpointer val, gpointer user_data) {
  */
 #define TRANSFER_IN_NOTHING (GI_TRANSFER_EVERYTHING + 1)
 
-static JSBool
+static bool
 gjs_g_arg_release_internal(JSContext  *context,
                            GITransfer  transfer,
                            GITypeInfo *type_info,
                            GITypeTag   type_tag,
                            GArgument  *arg)
 {
-    JSBool failed;
+    bool failed;
 
     g_assert(transfer != GI_TRANSFER_NOTHING);
 
-    failed = JS_FALSE;
+    failed = false;
 
     switch (type_tag) {
     case GI_TYPE_TAG_VOID:
@@ -3017,7 +3016,7 @@ gjs_g_arg_release_internal(JSContext  *context,
             } else if (gtype == G_TYPE_NONE) {
                 if (transfer != TRANSFER_IN_NOTHING) {
                     gjs_throw(context, "Don't know how to release GArgument: not an object or boxed type");
-                    failed = JS_TRUE;
+                    failed = true;
                 }
             } else if (G_TYPE_IS_INSTANTIATABLE(gtype)) {
                 if (transfer != TRANSFER_IN_NOTHING)
@@ -3025,7 +3024,7 @@ gjs_g_arg_release_internal(JSContext  *context,
             } else {
                 gjs_throw(context, "Unhandled GType %s releasing GArgument",
                           g_type_name(gtype));
-                failed = JS_TRUE;
+                failed = true;
             }
 
         out:
@@ -3052,7 +3051,7 @@ gjs_g_arg_release_internal(JSContext  *context,
                                                 param_info,
                                                 g_type_info_get_tag(param_info),
                                                 &elem)) {
-                    failed = JS_TRUE;
+                    failed = true;
                 }
             }
 
@@ -3085,7 +3084,7 @@ gjs_g_arg_release_internal(JSContext  *context,
                                   "Releasing a flat GValue array that was not fixed-size or was nested"
                                   "inside another container. This is not supported (and will leak)");
                         g_base_info_unref(param_info);
-                        return JS_FALSE;
+                        return false;
                     }
 
                     for (i = 0; i < len; i++) {
@@ -3096,7 +3095,7 @@ gjs_g_arg_release_internal(JSContext  *context,
 
                 g_free(arg->v_pointer);
                 g_base_info_unref(param_info);
-                return JS_TRUE;
+                return true;
             }
 
             switch (element_type) {
@@ -3137,7 +3136,7 @@ gjs_g_arg_release_internal(JSContext  *context,
                                                             param_info,
                                                             element_type,
                                                             &elem)) {
-                                failed = JS_TRUE;
+                                failed = true;
                             }
                         }
                     } else {
@@ -3166,7 +3165,7 @@ gjs_g_arg_release_internal(JSContext  *context,
                 gjs_throw(context,
                           "Releasing a C array with explicit length, that was nested"
                           "inside another container. This is not supported (and will leak)");
-                failed = JS_TRUE;
+                failed = true;
             }
 
             g_base_info_unref((GIBaseInfo*) param_info);
@@ -3224,7 +3223,7 @@ gjs_g_arg_release_internal(JSContext  *context,
                 gjs_throw(context,
                           "Don't know how to release GArray element-type %d",
                           element_type);
-                failed = JS_TRUE;
+                failed = true;
             }
 
             g_base_info_unref((GIBaseInfo*) param_info);
@@ -3279,7 +3278,7 @@ gjs_g_arg_release_internal(JSContext  *context,
                                                 param_info,
                                                 g_type_info_get_tag(param_info),
                                                 &elem)) {
-                    failed = JS_TRUE;
+                    failed = true;
                 }
             }
 
@@ -3297,7 +3296,7 @@ gjs_g_arg_release_internal(JSContext  *context,
                 GHR_closure c = {
                     context, NULL, NULL,
                     transfer,
-                    JS_FALSE
+                    false
                 };
 
                 c.key_param_info = g_type_info_get_param_type(type_info, 0);
@@ -3321,13 +3320,13 @@ gjs_g_arg_release_internal(JSContext  *context,
     default:
         g_warning("Unhandled type %s releasing GArgument",
                   g_type_tag_to_string(type_tag));
-        return JS_FALSE;
+        return false;
     }
 
     return !failed;
 }
 
-JSBool
+bool
 gjs_g_argument_release(JSContext  *context,
                        GITransfer  transfer,
                        GITypeInfo *type_info,
@@ -3336,7 +3335,7 @@ gjs_g_argument_release(JSContext  *context,
     GITypeTag type_tag;
 
     if (transfer == GI_TRANSFER_NOTHING)
-        return JS_TRUE;
+        return true;
 
     type_tag = g_type_info_get_tag( (GITypeInfo*) type_info);
 
@@ -3347,7 +3346,7 @@ gjs_g_argument_release(JSContext  *context,
     return gjs_g_arg_release_internal(context, transfer, type_info, type_tag, arg);
 }
 
-JSBool
+bool
 gjs_g_argument_release_in_arg(JSContext  *context,
                               GITransfer  transfer,
                               GITypeInfo *type_info,
@@ -3362,7 +3361,7 @@ gjs_g_argument_release_in_arg(JSContext  *context,
      *   an error and we won't get here.
      */
     if (transfer != GI_TRANSFER_NOTHING)
-        return JS_TRUE;
+        return true;
 
     type_tag = g_type_info_get_tag( (GITypeInfo*) type_info);
 
@@ -3374,10 +3373,10 @@ gjs_g_argument_release_in_arg(JSContext  *context,
         return gjs_g_arg_release_internal(context, (GITransfer) TRANSFER_IN_NOTHING,
                                           type_info, type_tag, arg);
 
-    return JS_TRUE;
+    return true;
 }
 
-JSBool
+bool
 gjs_g_argument_release_in_array (JSContext  *context,
                                  GITransfer  transfer,
                                  GITypeInfo *type_info,
@@ -3388,11 +3387,11 @@ gjs_g_argument_release_in_array (JSContext  *context,
     gpointer *array;
     GArgument elem;
     guint i;
-    JSBool ret = JS_TRUE;
+    bool ret = true;
     GITypeTag type_tag;
 
     if (transfer != GI_TRANSFER_NOTHING)
-        return JS_TRUE;
+        return true;
 
     gjs_debug_marshal(GJS_DEBUG_GFUNCTION,
                       "Releasing GArgument array in param");
@@ -3414,7 +3413,7 @@ gjs_g_argument_release_in_array (JSContext  *context,
             elem.v_pointer = array[i];
             if (!gjs_g_arg_release_internal(context, (GITransfer) TRANSFER_IN_NOTHING,
                                             param_type, type_tag, &elem)) {
-                ret = JS_FALSE;
+                ret = false;
                 break;
             }
         }
@@ -3426,7 +3425,7 @@ gjs_g_argument_release_in_array (JSContext  *context,
     return ret;
 }
 
-JSBool
+bool
 gjs_g_argument_release_out_array (JSContext  *context,
                                   GITransfer  transfer,
                                   GITypeInfo *type_info,
@@ -3437,11 +3436,11 @@ gjs_g_argument_release_out_array (JSContext  *context,
     gpointer *array;
     GArgument elem;
     guint i;
-    JSBool ret = JS_TRUE;
+    bool ret = true;
     GITypeTag type_tag;
 
     if (transfer == GI_TRANSFER_NOTHING)
-        return JS_TRUE;
+        return true;
 
     gjs_debug_marshal(GJS_DEBUG_GFUNCTION,
                       "Releasing GArgument array out param");
@@ -3460,7 +3459,7 @@ gjs_g_argument_release_out_array (JSContext  *context,
                                             param_type,
                                             type_tag,
                                             &elem)) {
-                ret = JS_FALSE;
+                ret = false;
             }
         }
     }
diff --git a/gi/arg.h b/gi/arg.h
index f22f4cc..e330cae 100644
--- a/gi/arg.h
+++ b/gi/arg.h
@@ -42,79 +42,79 @@ typedef enum {
     GJS_ARGUMENT_ARRAY_ELEMENT
 } GjsArgumentType;
 
-JSBool gjs_value_to_arg   (JSContext  *context,
-                           JS::Value   value,
-                           GIArgInfo  *arg_info,
-                           GArgument  *arg);
-
-JSBool gjs_value_to_explicit_array (JSContext  *context,
-                                    JS::Value   value,
-                                    GIArgInfo  *arg_info,
-                                    GArgument  *arg,
-                                    gsize      *length_p);
+bool gjs_value_to_arg (JSContext *context,
+                       JS::Value  value,
+                       GIArgInfo *arg_info,
+                       GArgument *arg);
+
+bool gjs_value_to_explicit_array (JSContext *context,
+                                  JS::Value  value,
+                                  GIArgInfo *arg_info,
+                                  GArgument *arg,
+                                  gsize     *length_p);
 
 void gjs_g_argument_init_default (JSContext      *context,
                                   GITypeInfo     *type_info,
                                   GArgument      *arg);
 
-JSBool gjs_value_to_g_argument (JSContext      *context,
-                                JS::Value       value,
-                                GITypeInfo     *type_info,
-                                const char     *arg_name,
-                                GjsArgumentType argument_type,
-                                GITransfer      transfer,
-                                gboolean        may_be_null,
-                                GArgument      *arg);
-
-JSBool gjs_value_from_g_argument (JSContext  *context,
-                                  JS::Value  *value_p,
-                                  GITypeInfo *type_info,
-                                  GArgument  *arg,
-                                  gboolean    copy_structs);
-JSBool gjs_value_from_explicit_array (JSContext  *context,
-                                      JS::Value  *value_p,
-                                      GITypeInfo *type_info,
-                                      GArgument  *arg,
-                                      int         length);
-
-JSBool gjs_g_argument_release    (JSContext  *context,
-                                  GITransfer  transfer,
-                                  GITypeInfo *type_info,
-                                  GArgument  *arg);
-JSBool gjs_g_argument_release_out_array (JSContext  *context,
-                                         GITransfer  transfer,
-                                         GITypeInfo *type_info,
-                                         guint       length,
-                                         GArgument  *arg);
-JSBool gjs_g_argument_release_in_array (JSContext  *context,
-                                        GITransfer  transfer,
-                                        GITypeInfo *type_info,
-                                        guint       length,
-                                        GArgument  *arg);
-JSBool gjs_g_argument_release_in_arg (JSContext  *context,
+bool gjs_value_to_g_argument (JSContext      *context,
+                              JS::Value       value,
+                              GITypeInfo     *type_info,
+                              const char     *arg_name,
+                              GjsArgumentType argument_type,
+                              GITransfer      transfer,
+                              gboolean        may_be_null,
+                              GArgument      *arg);
+
+bool gjs_value_from_g_argument (JSContext  *context,
+                                JS::Value  *value_p,
+                                GITypeInfo *type_info,
+                                GArgument  *arg,
+                                gboolean    copy_structs);
+bool gjs_value_from_explicit_array (JSContext  *context,
+                                    JS::Value  *value_p,
+                                    GITypeInfo *type_info,
+                                    GArgument  *arg,
+                                    int         length);
+
+bool gjs_g_argument_release    (JSContext  *context,
+                                GITransfer  transfer,
+                                GITypeInfo *type_info,
+                                GArgument  *arg);
+bool gjs_g_argument_release_out_array (JSContext  *context,
+                                       GITransfer  transfer,
+                                       GITypeInfo *type_info,
+                                       guint       length,
+                                       GArgument  *arg);
+bool gjs_g_argument_release_in_array (JSContext  *context,
                                       GITransfer  transfer,
                                       GITypeInfo *type_info,
+                                      guint       length,
                                       GArgument  *arg);
+bool gjs_g_argument_release_in_arg (JSContext  *context,
+                                    GITransfer  transfer,
+                                    GITypeInfo *type_info,
+                                    GArgument  *arg);
 
-JSBool _gjs_flags_value_is_valid (JSContext   *context,
-                                  GType        gtype,
-                                  gint64       value);
+bool _gjs_flags_value_is_valid (JSContext   *context,
+                                GType        gtype,
+                                gint64       value);
 
-JSBool _gjs_enum_value_is_valid (JSContext  *context,
-                                 GIEnumInfo *enum_info,
-                                 gint64      value);
+bool _gjs_enum_value_is_valid (JSContext  *context,
+                               GIEnumInfo *enum_info,
+                               gint64      value);
 
 gint64 _gjs_enum_from_int (GIEnumInfo *enum_info,
                            int         int_value);
 
-JSBool gjs_array_from_strv (JSContext   *context,
-                            JS::Value   *value_p,
-                            const char **strv);
+bool gjs_array_from_strv (JSContext   *context,
+                          JS::Value   *value_p,
+                          const char **strv);
 
-JSBool gjs_array_to_strv (JSContext   *context,
-                          JS::Value    array_value,
-                          unsigned int length,
-                          void       **arr_p);
+bool gjs_array_to_strv (JSContext   *context,
+                        JS::Value    array_value,
+                        unsigned int length,
+                        void       **arr_p);
 
 G_END_DECLS
 
diff --git a/gi/boxed.cpp b/gi/boxed.cpp
index 5acf673..1536759 100644
--- a/gi/boxed.cpp
+++ b/gi/boxed.cpp
@@ -60,16 +60,16 @@ typedef struct {
 
 static gboolean struct_is_simple(GIStructInfo *info);
 
-static JSBool boxed_set_field_from_value(JSContext   *context,
-                                         Boxed       *priv,
-                                         GIFieldInfo *field_info,
-                                         JS::Value    value);
+static bool boxed_set_field_from_value(JSContext   *context,
+                                       Boxed       *priv,
+                                       GIFieldInfo *field_info,
+                                       JS::Value    value);
 
 extern struct JSClass gjs_boxed_class;
 
 GJS_DEFINE_PRIV_FROM_JS(Boxed, gjs_boxed_class)
 
-static JSBool
+static bool
 gjs_define_static_methods(JSContext    *context,
                           JSObject     *constructor,
                           GType         gtype,
@@ -101,7 +101,7 @@ gjs_define_static_methods(JSContext    *context,
 
         g_base_info_unref((GIBaseInfo*) meth_info);
     }
-    return JS_TRUE;
+    return true;
 }
 
 /*
@@ -117,7 +117,7 @@ gjs_define_static_methods(JSContext    *context,
  * was not resolved; and non-null, referring to obj or one of its prototypes,
  * if id was resolved.
  */
-static JSBool
+static bool
 boxed_new_resolve(JSContext *context,
                   JS::HandleObject obj,
                   JS::HandleId id,
@@ -126,10 +126,10 @@ boxed_new_resolve(JSContext *context,
 {
     Boxed *priv;
     char *name;
-    JSBool ret = JS_FALSE;
+    bool ret = false;
 
     if (!gjs_get_string_id(context, id, &name))
-        return JS_TRUE; /* not resolved, but no error */
+        return true; /* not resolved, but no error */
 
     priv = priv_from_js(context, obj);
     gjs_debug_jsprop(GJS_DEBUG_GBOXED, "Resolve prop '%s' hook obj %p priv %p",
@@ -183,7 +183,7 @@ boxed_new_resolve(JSContext *context,
          * hooks, not this resolve hook.
          */
     }
-    ret = JS_TRUE;
+    ret = true;
 
  out:
     g_free(name);
@@ -193,7 +193,7 @@ boxed_new_resolve(JSContext *context,
 /* Check to see if JS::Value passed in is another Boxed object of the same,
  * and if so, retrieves the Boxed private structure for it.
  */
-static JSBool
+static bool
 boxed_get_copy_source(JSContext *context,
                       Boxed     *priv,
                       JS::Value  value,
@@ -202,17 +202,17 @@ boxed_get_copy_source(JSContext *context,
     Boxed *source_priv;
 
     if (!value.isObject())
-        return JS_FALSE;
+        return false;
 
     if (!priv_from_js_with_typecheck(context, &value.toObject(), &source_priv))
-        return JS_FALSE;
+        return false;
 
     if (!g_base_info_equal((GIBaseInfo*) priv->info, (GIBaseInfo*) source_priv->info))
-        return JS_FALSE;
+        return false;
 
     *source_priv_out = source_priv;
 
-    return JS_TRUE;
+    return true;
 }
 
 static void
@@ -255,7 +255,7 @@ get_field_map(GIStructInfo *struct_info)
  * properties to set as fieds of the object. We don't require that every field
  * of the object be set.
  */
-static JSBool
+static bool
 boxed_init_from_props(JSContext   *context,
                       JSObject    *obj,
                       Boxed       *priv,
@@ -270,7 +270,7 @@ boxed_init_from_props(JSContext   *context,
 
     if (!props_value.isObject()) {
         gjs_throw(context, "argument should be a hash with fields to set");
-        return JS_FALSE;
+        return false;
     }
 
     props = &props_value.toObject();
@@ -278,7 +278,7 @@ boxed_init_from_props(JSContext   *context,
     iter = JS_NewPropertyIterator(context, props);
     if (iter == NULL) {
         gjs_throw(context, "Failed to create property iterator for fields hash");
-        return JS_FALSE;
+        return false;
     }
 
     if (!priv->field_map)
@@ -325,7 +325,7 @@ boxed_init_from_props(JSContext   *context,
     return success;
 }
 
-static JSBool
+static bool
 boxed_invoke_constructor(JSContext   *context,
                          JSObject    *obj,
                          jsid         constructor_name,
@@ -338,16 +338,16 @@ boxed_invoke_constructor(JSContext   *context,
 
     constructor_const = gjs_context_get_const_string(context, GJS_STRING_CONSTRUCTOR);
     if (!gjs_object_require_property(context, obj, NULL, constructor_const, &js_constructor))
-        return JS_FALSE;
+        return false;
 
     if (!gjs_object_require_property(context, &js_constructor.toObject(), NULL,
                                      constructor_name, &js_constructor_func))
-        return JS_FALSE;
+        return false;
 
     return gjs_call_function_value(context, NULL, js_constructor_func, argc, argv, rval);
 }
 
-static JSBool
+static bool
 boxed_new(JSContext   *context,
           JSObject    *obj, /* "this" for constructor */
           Boxed       *priv,
@@ -383,7 +383,7 @@ boxed_new(JSContext   *context,
             gjs_throw(context, "Failed to invoke boxed constructor: %s", error->message);
             g_clear_error(&error);
             g_base_info_unref((GIBaseInfo*) func_info);
-            return JS_FALSE;
+            return false;
         }
 
         g_base_info_unref((GIBaseInfo*) func_info);
@@ -397,7 +397,7 @@ boxed_new(JSContext   *context,
     } else if (priv->can_allocate_directly) {
         boxed_new_direct(priv);
     } else if (priv->default_constructor >= 0) {
-        JSBool retval;
+        bool retval;
 
         /* for simplicity, we simply delegate all the work to the actual JS constructor
            function (which we retrieve from the JS constructor, that is, Namespace.BoxedType,
@@ -407,18 +407,18 @@ boxed_new(JSContext   *context,
     } else {
         gjs_throw(context, "Unable to construct struct type %s since it has no default constructor and 
cannot be allocated directly",
                   g_base_info_get_name((GIBaseInfo*) priv->info));
-        return JS_FALSE;
+        return false;
     }
 
     /* If we reach this code, we need to init from a map of fields */
 
     if (argc == 0)
-        return JS_TRUE;
+        return true;
 
     if (argc > 1) {
         gjs_throw(context, "Constructor with multiple arguments not supported for %s",
                   g_base_info_get_name((GIBaseInfo *)priv->info));
-        return JS_FALSE;
+        return false;
     }
 
     return boxed_init_from_props (context, obj, priv, argv[0]);
@@ -432,7 +432,7 @@ GJS_NATIVE_CONSTRUCTOR_DECLARE(boxed)
     JSObject *proto;
     Boxed *source_priv;
     JS::Value actual_rval;
-    JSBool retval;
+    bool retval;
 
     GJS_NATIVE_CONSTRUCTOR_PRELUDE(boxed);
 
@@ -457,7 +457,7 @@ GJS_NATIVE_CONSTRUCTOR_DECLARE(boxed)
     if (proto_priv == NULL) {
         gjs_debug(GJS_DEBUG_GBOXED,
                   "Bad prototype set on boxed? Must match JSClass of object. JS error should have been 
reported.");
-        return JS_FALSE;
+        return false;
     }
 
     *priv = *proto_priv;
@@ -471,14 +471,14 @@ GJS_NATIVE_CONSTRUCTOR_DECLARE(boxed)
             priv->gboxed = g_boxed_copy(priv->gtype, source_priv->gboxed);
 
             GJS_NATIVE_CONSTRUCTOR_FINISH(boxed);
-            return JS_TRUE;
+            return true;
         } else if (priv->can_allocate_directly) {
             boxed_new_direct (priv);
             memcpy(priv->gboxed, source_priv->gboxed,
                    g_struct_info_get_size (priv->info));
 
             GJS_NATIVE_CONSTRUCTOR_FINISH(boxed);
-            return JS_TRUE;
+            return true;
         }
     }
 
@@ -575,7 +575,7 @@ get_field_info (JSContext *context,
     return NULL;
 }
 
-static JSBool
+static bool
 get_nested_interface_object (JSContext   *context,
                              JSObject    *parent_obj,
                              Boxed       *parent_priv,
@@ -595,7 +595,7 @@ get_nested_interface_object (JSContext   *context,
                   g_base_info_get_name ((GIBaseInfo *)parent_priv->info),
                   g_base_info_get_name ((GIBaseInfo *)field_info));
 
-        return JS_FALSE;
+        return false;
     }
 
     proto = gjs_lookup_generic_prototype(context, (GIBoxedInfo*) interface_info);
@@ -608,7 +608,7 @@ get_nested_interface_object (JSContext   *context,
                                      gjs_get_import_global (context));
 
     if (obj == NULL)
-        return JS_FALSE;
+        return false;
 
     GJS_INC_COUNTER(boxed);
     priv = g_slice_new0(Boxed);
@@ -628,7 +628,7 @@ get_nested_interface_object (JSContext   *context,
     JS_SetReservedSlot(obj, 0, JS::ObjectValue(*parent_obj));
 
     *value = JS::ObjectValue(*obj);
-    return JS_TRUE;
+    return true;
 }
 
 static JSBool
@@ -645,11 +645,11 @@ boxed_field_getter (JSContext              *context,
 
     priv = priv_from_js(context, obj);
     if (!priv)
-        return JS_FALSE;
+        return false;
 
     field_info = get_field_info(context, priv, id);
     if (!field_info)
-        return JS_FALSE;
+        return false;
 
     type_info = g_field_info_get_type (field_info);
 
@@ -701,7 +701,7 @@ out:
     return success;
 }
 
-static JSBool
+static bool
 set_nested_interface_object (JSContext   *context,
                              Boxed       *parent_priv,
                              GIFieldInfo *field_info,
@@ -719,7 +719,7 @@ set_nested_interface_object (JSContext   *context,
                   g_base_info_get_name ((GIBaseInfo *)parent_priv->info),
                   g_base_info_get_name ((GIBaseInfo *)field_info));
 
-        return JS_FALSE;
+        return false;
     }
 
     proto = gjs_lookup_generic_prototype(context, (GIBoxedInfo*) interface_info);
@@ -731,11 +731,11 @@ set_nested_interface_object (JSContext   *context,
     if (!boxed_get_copy_source(context, proto_priv, value, &source_priv)) {
         JSObject *tmp_object = gjs_construct_object_dynamic(context, proto, 1, &value);
         if (!tmp_object)
-            return JS_FALSE;
+            return false;
 
         source_priv = priv_from_js(context, tmp_object);
         if (!source_priv)
-            return JS_FALSE;
+            return false;
     }
 
     offset = g_field_info_get_offset (field_info);
@@ -743,10 +743,10 @@ set_nested_interface_object (JSContext   *context,
            source_priv->gboxed,
            g_struct_info_get_size (source_priv->info));
 
-    return JS_TRUE;
+    return true;
 }
 
-static JSBool
+static bool
 boxed_set_field_from_value(JSContext   *context,
                            Boxed       *priv,
                            GIFieldInfo *field_info,
@@ -823,10 +823,10 @@ boxed_field_setter (JSContext              *context,
 
     priv = priv_from_js(context, obj);
     if (!priv)
-        return JS_FALSE;
+        return false;
     field_info = get_field_info(context, priv, id);
     if (!field_info)
-        return JS_FALSE;
+        return false;
 
     if (priv->gboxed == NULL) { /* direct access to proto field */
         gjs_throw(context, "Can't set field %s.%s on prototype",
@@ -842,7 +842,7 @@ out:
     return success;
 }
 
-static JSBool
+static bool
 define_boxed_class_fields (JSContext *context,
                            Boxed     *priv,
                            JSObject  *proto)
@@ -883,13 +883,13 @@ define_boxed_class_fields (JSContext *context,
         g_base_info_unref ((GIBaseInfo *)field);
 
         if (!result)
-            return JS_FALSE;
+            return false;
     }
 
-    return JS_TRUE;
+    return true;
 }
 
-static JSBool
+static bool
 to_string_func(JSContext *context,
                unsigned   argc,
                JS::Value *vp)
@@ -898,7 +898,7 @@ to_string_func(JSContext *context,
     JSObject *obj = rec.thisv().toObjectOrNull();
 
     Boxed *priv;
-    JSBool ret = JS_FALSE;
+    bool ret = false;
     JS::Value retval;
 
     if (!priv_from_js_with_typecheck(context, obj, &priv))
@@ -908,7 +908,7 @@ to_string_func(JSContext *context,
                                    priv->gtype, priv->gboxed, &retval))
         goto out;
 
-    ret = JS_TRUE;
+    ret = true;
     rec.rval().set(retval);
  out:
     return ret;
@@ -1265,18 +1265,18 @@ gjs_c_struct_from_boxed(JSContext    *context,
     return priv->gboxed;
 }
 
-JSBool
+bool
 gjs_typecheck_boxed(JSContext     *context,
                     JSObject      *object,
                     GIStructInfo  *expected_info,
                     GType          expected_type,
-                    JSBool         throw_error)
+                    bool           throw_error)
 {
     Boxed *priv;
-    JSBool result;
+    bool result;
 
     if (!do_base_typecheck(context, object, throw_error))
-        return JS_FALSE;
+        return false;
 
     priv = priv_from_js(context, object);
 
@@ -1288,7 +1288,7 @@ gjs_typecheck_boxed(JSContext     *context,
                              g_base_info_get_name( (GIBaseInfo*) priv->info));
         }
 
-        return JS_FALSE;
+        return false;
     }
 
     if (expected_type != G_TYPE_NONE)
@@ -1296,7 +1296,7 @@ gjs_typecheck_boxed(JSContext     *context,
     else if (expected_info != NULL)
         result = g_base_info_equal((GIBaseInfo*) priv->info, (GIBaseInfo*) expected_info);
     else
-        result = JS_TRUE;
+        result = true;
 
     if (!result && throw_error) {
         if (expected_info != NULL) {
diff --git a/gi/boxed.h b/gi/boxed.h
index 65448f7..e5d320f 100644
--- a/gi/boxed.h
+++ b/gi/boxed.h
@@ -51,11 +51,11 @@ JSObject* gjs_boxed_from_c_struct      (JSContext             *context,
                                         GIStructInfo          *info,
                                         void                  *gboxed,
                                         GjsBoxedCreationFlags  flags);
-JSBool    gjs_typecheck_boxed          (JSContext             *context,
+bool      gjs_typecheck_boxed          (JSContext             *context,
                                         JSObject              *obj,
                                         GIStructInfo          *expected_info,
                                         GType                  expected_type,
-                                        JSBool                 throw_error);
+                                        bool                   throw_error);
 
 G_END_DECLS
 
diff --git a/gi/enumeration.cpp b/gi/enumeration.cpp
index 32e3013..682f7af 100644
--- a/gi/enumeration.cpp
+++ b/gi/enumeration.cpp
@@ -61,7 +61,7 @@ gjs_lookup_enumeration(JSContext    *context,
     return &value.toObject();
 }
 
-static JSBool
+static bool
 gjs_define_enum_value(JSContext    *context,
                       JSObject     *in_object,
                       GIValueInfo  *info)
@@ -99,14 +99,14 @@ gjs_define_enum_value(JSContext    *context,
         gjs_throw(context, "Unable to define enumeration value %s %" G_GINT64_FORMAT " (no memory most 
likely)",
                   fixed_name, value_val);
         g_free(fixed_name);
-        return JS_FALSE;
+        return false;
     }
     g_free(fixed_name);
 
-    return JS_TRUE;
+    return true;
 }
 
-JSBool
+bool
 gjs_define_enum_values(JSContext    *context,
                        JSObject     *in_object,
                        GIEnumInfo   *info)
@@ -128,7 +128,7 @@ gjs_define_enum_values(JSContext    *context,
         g_base_info_unref( (GIBaseInfo*) value_info);
 
         if (failed) {
-            return JS_FALSE;
+            return false;
         }
     }
 
@@ -137,10 +137,10 @@ gjs_define_enum_values(JSContext    *context,
     JS_DefineProperty(context, in_object, "$gtype", value,
                       NULL, NULL, JSPROP_PERMANENT);
 
-    return JS_TRUE;
+    return true;
 }
 
-JSBool
+bool
 gjs_define_enum_static_methods(JSContext    *context,
                                JSObject     *constructor,
                                GIEnumInfo   *enum_info)
@@ -172,10 +172,10 @@ gjs_define_enum_static_methods(JSContext    *context,
         g_base_info_unref((GIBaseInfo*) meth_info);
     }
 
-    return JS_TRUE;
+    return true;
 }
 
-JSBool
+bool
 gjs_define_enumeration(JSContext    *context,
                        JSObject     *in_object,
                        GIEnumInfo   *info)
@@ -206,7 +206,7 @@ gjs_define_enumeration(JSContext    *context,
                  gjs_get_import_global (context));
 
     if (!gjs_define_enum_values(context, enum_obj, info))
-        return JS_FALSE;
+        return false;
     gjs_define_enum_static_methods (context, enum_obj, info);
 
     gjs_debug(GJS_DEBUG_GENUM,
@@ -219,8 +219,8 @@ gjs_define_enumeration(JSContext    *context,
                            NULL, NULL,
                            GJS_MODULE_PROP_FLAGS)) {
         gjs_throw(context, "Unable to define enumeration property (no memory most likely)");
-        return JS_FALSE;
+        return false;
     }
 
-    return JS_TRUE;
+    return true;
 }
diff --git a/gi/enumeration.h b/gi/enumeration.h
index 89f6d46..991e18a 100644
--- a/gi/enumeration.h
+++ b/gi/enumeration.h
@@ -32,13 +32,13 @@
 
 G_BEGIN_DECLS
 
-JSBool    gjs_define_enum_values       (JSContext    *context,
+bool    gjs_define_enum_values         (JSContext    *context,
                                         JSObject     *in_object,
                                         GIEnumInfo   *info);
-JSBool    gjs_define_enum_static_methods(JSContext    *context,
-                                         JSObject     *constructor,
-                                         GIEnumInfo   *enum_info);
-JSBool    gjs_define_enumeration       (JSContext    *context,
+bool    gjs_define_enum_static_methods (JSContext    *context,
+                                        JSObject     *constructor,
+                                        GIEnumInfo   *enum_info);
+bool    gjs_define_enumeration         (JSContext    *context,
                                         JSObject     *in_object,
                                         GIEnumInfo   *info);
 JSObject* gjs_lookup_enumeration       (JSContext    *context,
diff --git a/gi/foreign.cpp b/gi/foreign.cpp
index b07b95b..12d7d45 100644
--- a/gi/foreign.cpp
+++ b/gi/foreign.cpp
@@ -55,7 +55,7 @@ get_foreign_structs(void)
     return foreign_structs_table;
 }
 
-static JSBool
+static bool
 gjs_foreign_load_foreign_module(JSContext *context,
                                 const gchar *gi_namespace)
 {
@@ -70,7 +70,7 @@ gjs_foreign_load_foreign_module(JSContext *context,
             continue;
 
         if (foreign_modules[i].loaded)
-            return JS_TRUE;
+            return true;
 
         // FIXME: Find a way to check if a module is imported
         //        and only execute this statement if isn't
@@ -81,30 +81,30 @@ gjs_foreign_load_foreign_module(JSContext *context,
             g_printerr("ERROR: %s\n", error->message);
             g_free(script);
             g_error_free(error);
-            return JS_FALSE;
+            return false;
         }
         g_free(script);
         foreign_modules[i].loaded = TRUE;
-        return JS_TRUE;
+        return true;
     }
 
-    return JS_FALSE;
+    return false;
 }
 
-JSBool
+bool
 gjs_struct_foreign_register(const char *gi_namespace,
                             const char *type_name,
                             GjsForeignInfo *info)
 {
     char *canonical_name;
 
-    g_return_val_if_fail(info != NULL, JS_FALSE);
-    g_return_val_if_fail(info->to_func != NULL, JS_FALSE);
-    g_return_val_if_fail(info->from_func != NULL, JS_FALSE);
+    g_return_val_if_fail(info != NULL, false);
+    g_return_val_if_fail(info->to_func != NULL, false);
+    g_return_val_if_fail(info->from_func != NULL, false);
 
     canonical_name = g_strdup_printf("%s.%s", gi_namespace, type_name);
     g_hash_table_insert(get_foreign_structs(), canonical_name, info);
-    return JS_TRUE;
+    return true;
 }
 
 static GjsForeignInfo *
@@ -137,7 +137,7 @@ gjs_struct_foreign_lookup(JSContext  *context,
     return retval;
 }
 
-JSBool
+bool
 gjs_struct_foreign_convert_to_g_argument(JSContext      *context,
                                          JS::Value       value,
                                          GIBaseInfo     *interface_info,
@@ -151,16 +151,16 @@ gjs_struct_foreign_convert_to_g_argument(JSContext      *context,
 
     foreign = gjs_struct_foreign_lookup(context, interface_info);
     if (!foreign)
-        return JS_FALSE;
+        return false;
 
     if (!foreign->to_func(context, value, arg_name,
                            argument_type, transfer, may_be_null, arg))
-        return JS_FALSE;
+        return false;
 
-    return JS_TRUE;
+    return true;
 }
 
-JSBool
+bool
 gjs_struct_foreign_convert_from_g_argument(JSContext  *context,
                                            JS::Value  *value_p,
                                            GIBaseInfo *interface_info,
@@ -170,15 +170,15 @@ gjs_struct_foreign_convert_from_g_argument(JSContext  *context,
 
     foreign = gjs_struct_foreign_lookup(context, interface_info);
     if (!foreign)
-        return JS_FALSE;
+        return false;
 
     if (!foreign->from_func(context, value_p, arg))
-        return JS_FALSE;
+        return false;
 
-    return JS_TRUE;
+    return true;
 }
 
-JSBool
+bool
 gjs_struct_foreign_release_g_argument(JSContext  *context,
                                       GITransfer  transfer,
                                       GIBaseInfo *interface_info,
@@ -188,14 +188,14 @@ gjs_struct_foreign_release_g_argument(JSContext  *context,
 
     foreign = gjs_struct_foreign_lookup(context, interface_info);
     if (!foreign)
-        return JS_FALSE;
+        return false;
 
     if (!foreign->release_func)
-        return JS_TRUE;
+        return true;
 
     if (!foreign->release_func(context, transfer, arg))
-        return JS_FALSE;
+        return false;
 
-    return JS_TRUE;
+    return true;
 }
 
diff --git a/gi/foreign.h b/gi/foreign.h
index 6cdde45..c877d4b 100644
--- a/gi/foreign.h
+++ b/gi/foreign.h
@@ -28,20 +28,20 @@
 #include <gjs/gjs.h>
 #include "arg.h"
 
-typedef JSBool (*GjsArgOverrideToGArgumentFunc) (JSContext      *context,
-                                                 JS::Value       value,
-                                                 const char     *arg_name,
-                                                 GjsArgumentType argument_type,
-                                                 GITransfer      transfer,
-                                                 gboolean        may_be_null,
-                                                 GArgument      *arg);
+typedef bool (*GjsArgOverrideToGArgumentFunc) (JSContext      *context,
+                                               JS::Value       value,
+                                               const char     *arg_name,
+                                               GjsArgumentType argument_type,
+                                               GITransfer      transfer,
+                                               gboolean        may_be_null,
+                                               GArgument      *arg);
 
-typedef JSBool (*GjsArgOverrideFromGArgumentFunc) (JSContext  *context,
-                                                   JS::Value  *value_p,
-                                                   GArgument  *arg);
-typedef JSBool (*GjsArgOverrideReleaseGArgumentFunc) (JSContext  *context,
-                                                      GITransfer  transfer,
-                                                      GArgument  *arg);
+typedef bool (*GjsArgOverrideFromGArgumentFunc)    (JSContext *context,
+                                                    JS::Value *value_p,
+                                                    GArgument *arg);
+typedef bool (*GjsArgOverrideReleaseGArgumentFunc) (JSContext *context,
+                                                    GITransfer transfer,
+                                                    GArgument *arg);
 
 typedef struct {
     GjsArgOverrideToGArgumentFunc to_func;
@@ -49,25 +49,25 @@ typedef struct {
     GjsArgOverrideReleaseGArgumentFunc release_func;
 } GjsForeignInfo;
 
-JSBool  gjs_struct_foreign_register                (const char         *gi_namespace,
-                                                    const char         *type_name,
-                                                    GjsForeignInfo *info);
+bool  gjs_struct_foreign_register                (const char     *gi_namespace,
+                                                  const char     *type_name,
+                                                  GjsForeignInfo *info);
 
-JSBool  gjs_struct_foreign_convert_to_g_argument   (JSContext          *context,
-                                                    JS::Value           value,
-                                                    GIBaseInfo         *interface_info,
-                                                    const char         *arg_name,
-                                                    GjsArgumentType     argument_type,
-                                                    GITransfer          transfer,
-                                                    gboolean            may_be_null,
-                                                    GArgument          *arg);
-JSBool  gjs_struct_foreign_convert_from_g_argument (JSContext          *context,
-                                                    JS::Value          *value_p,
-                                                    GIBaseInfo         *interface_info,
-                                                    GArgument          *arg);
-JSBool  gjs_struct_foreign_release_g_argument      (JSContext          *context,
-                                                    GITransfer          transfer,
-                                                    GIBaseInfo         *interface_info,
-                                                    GArgument          *arg);
+bool  gjs_struct_foreign_convert_to_g_argument   (JSContext      *context,
+                                                  JS::Value       value,
+                                                  GIBaseInfo     *interface_info,
+                                                  const char     *arg_name,
+                                                  GjsArgumentType argument_type,
+                                                  GITransfer      transfer,
+                                                  gboolean        may_be_null,
+                                                  GArgument      *arg);
+bool  gjs_struct_foreign_convert_from_g_argument (JSContext      *context,
+                                                  JS::Value      *value_p,
+                                                  GIBaseInfo     *interface_info,
+                                                  GArgument      *arg);
+bool  gjs_struct_foreign_release_g_argument      (JSContext      *context,
+                                                  GITransfer      transfer,
+                                                  GIBaseInfo     *interface_info,
+                                                  GArgument      *arg);
 
 #endif /* __GJS_OVERRIDE_H__ */
diff --git a/gi/function.cpp b/gi/function.cpp
index eab4313..9538181 100644
--- a/gi/function.cpp
+++ b/gi/function.cpp
@@ -536,7 +536,7 @@ get_length_from_arg (GArgument *arg, GITypeTag tag)
     }
 }
 
-static JSBool
+static bool
 gjs_fill_method_instance (JSContext  *context,
                           JSObject   *obj,
                           Function   *function,
@@ -552,8 +552,8 @@ gjs_fill_method_instance (JSContext  *context,
     case GI_INFO_TYPE_BOXED:
         /* GError must be special cased */
         if (g_type_is_a(gtype, G_TYPE_ERROR)) {
-            if (!gjs_typecheck_gerror(context, obj, JS_TRUE))
-                return JS_FALSE;
+            if (!gjs_typecheck_gerror(context, obj, true))
+                return false;
 
             out_arg->v_pointer = gjs_gerror_from_error(context, obj);
             if (transfer == GI_TRANSFER_EVERYTHING)
@@ -568,7 +568,7 @@ gjs_fill_method_instance (JSContext  *context,
 
             if (actual_gtype == G_TYPE_NONE) {
                 gjs_throw(context, "Invalid GType class passed for instance parameter");
-                return JS_FALSE;
+                return false;
             }
 
             /* We use peek here to simplify reference counting (we just ignore
@@ -584,10 +584,8 @@ gjs_fill_method_instance (JSContext  *context,
 
             out_arg->v_pointer = klass;
         } else {
-            if (!gjs_typecheck_boxed(context, obj,
-                                     container, gtype,
-                                     JS_TRUE))
-                return JS_FALSE;
+            if (!gjs_typecheck_boxed(context, obj, container, gtype, true))
+                return false;
 
             out_arg->v_pointer = gjs_c_struct_from_boxed(context, obj);
             if (transfer == GI_TRANSFER_EVERYTHING) {
@@ -595,16 +593,15 @@ gjs_fill_method_instance (JSContext  *context,
                     out_arg->v_pointer = g_boxed_copy (gtype, out_arg->v_pointer);
                 else {
                     gjs_throw (context, "Cannot transfer ownership of instance argument for non boxed 
structure");
-                    return JS_FALSE;
+                    return false;
                 }
             }
         }
         break;
 
     case GI_INFO_TYPE_UNION:
-        if (!gjs_typecheck_union(context, obj,
-                                 container, gtype, JS_TRUE))
-            return JS_FALSE;
+        if (!gjs_typecheck_union(context, obj, container, gtype, true))
+            return false;
 
         out_arg->v_pointer = gjs_c_union_from_union(context, obj);
         if (transfer == GI_TRANSFER_EVERYTHING)
@@ -614,34 +611,34 @@ gjs_fill_method_instance (JSContext  *context,
     case GI_INFO_TYPE_OBJECT:
     case GI_INFO_TYPE_INTERFACE:
         if (g_type_is_a(gtype, G_TYPE_OBJECT)) {
-            if (!gjs_typecheck_object(context, obj, gtype, JS_TRUE))
-                return JS_FALSE;
+            if (!gjs_typecheck_object(context, obj, gtype, true))
+                return false;
             out_arg->v_pointer = gjs_g_object_from_object(context, obj);
             if (transfer == GI_TRANSFER_EVERYTHING)
                 g_object_ref (out_arg->v_pointer);
         } else if (g_type_is_a(gtype, G_TYPE_PARAM)) {
-            if (!gjs_typecheck_param(context, obj, G_TYPE_PARAM, JS_TRUE))
-                return JS_FALSE;
+            if (!gjs_typecheck_param(context, obj, G_TYPE_PARAM, true))
+                return false;
             out_arg->v_pointer = gjs_g_param_from_param(context, obj);
             if (transfer == GI_TRANSFER_EVERYTHING)
                 g_param_spec_ref ((GParamSpec*) out_arg->v_pointer);
         } else if (G_TYPE_IS_INTERFACE(gtype)) {
-            if (gjs_typecheck_is_object(context, obj, JS_FALSE)) {
-                if (!gjs_typecheck_object(context, obj, gtype, JS_TRUE))
-                    return JS_FALSE;
+            if (gjs_typecheck_is_object(context, obj, false)) {
+                if (!gjs_typecheck_object(context, obj, gtype, true))
+                    return false;
                 out_arg->v_pointer = gjs_g_object_from_object(context, obj);
                 if (transfer == GI_TRANSFER_EVERYTHING)
                     g_object_ref (out_arg->v_pointer);
             } else {
-                if (!gjs_typecheck_fundamental(context, obj, gtype, JS_TRUE))
-                    return JS_FALSE;
+                if (!gjs_typecheck_fundamental(context, obj, gtype, true))
+                    return false;
                 out_arg->v_pointer = gjs_g_fundamental_from_object(context, obj);
                 if (transfer == GI_TRANSFER_EVERYTHING)
                     gjs_fundamental_ref (context, out_arg->v_pointer);
             }
         } else if (G_TYPE_IS_INSTANTIATABLE(gtype)) {
-            if (!gjs_typecheck_fundamental(context, obj, gtype, JS_TRUE))
-                return JS_FALSE;
+            if (!gjs_typecheck_fundamental(context, obj, gtype, true))
+                return false;
             out_arg->v_pointer = gjs_g_fundamental_from_object(context, obj);
             if (transfer == GI_TRANSFER_EVERYTHING)
                 gjs_fundamental_ref (context, out_arg->v_pointer);
@@ -650,7 +647,7 @@ gjs_fill_method_instance (JSContext  *context,
                              "%s.%s is not an object instance neither a fundamental instance of a supported 
type",
                              g_base_info_get_namespace(container),
                              g_base_info_get_name(container));
-            return JS_FALSE;
+            return false;
         }
         break;
 
@@ -658,7 +655,7 @@ gjs_fill_method_instance (JSContext  *context,
         g_assert_not_reached();
     }
 
-    return JS_TRUE;
+    return true;
 }
 
 /*
@@ -667,7 +664,7 @@ gjs_fill_method_instance (JSContext  *context,
  * you can decide to keep the return values in #GArgument format by
  * providing a @r_value argument.
  */
-static JSBool
+static bool
 gjs_invoke_c_function(JSContext      *context,
                       Function       *function,
                       JSObject       *obj, /* "this" object */
@@ -750,7 +747,7 @@ gjs_invoke_c_function(JSContext      *context,
                   g_base_info_get_name( (GIBaseInfo*) function->info),
                   function->expected_js_argc,
                   js_argc);
-        return JS_FALSE;
+        return false;
     }
 
     g_callable_info_load_return_type( (GICallableInfo*) function->info, &return_info);
@@ -768,7 +765,7 @@ gjs_invoke_c_function(JSContext      *context,
     if (is_method) {
         if (!gjs_fill_method_instance(context, obj,
                                       function, &in_arg_cvalues[0]))
-            return JS_FALSE;
+            return false;
         ffi_arg_pointers[0] = &in_arg_cvalues[0];
         ++c_arg_pos;
     }
@@ -1289,11 +1286,11 @@ release:
 
     if (!failed && did_throw_gerror) {
         gjs_throw_g_error(context, local_error);
-        return JS_FALSE;
+        return false;
     } else if (failed) {
-        return JS_FALSE;
+        return false;
     } else {
-        return JS_TRUE;
+        return true;
     }
 }
 
@@ -1306,7 +1303,7 @@ function_call(JSContext *context,
     JSObject *object = js_argv.thisv().toObjectOrNull();
     JSObject *callee = &js_argv.callee();
 
-    JSBool success;
+    bool success;
     Function *priv;
     JS::Value retval;
 
@@ -1317,7 +1314,7 @@ function_call(JSContext *context,
                       JS_GetTypeName(context, JS_TypeOfValue(context, JS::ObjectOrNullValue(object))));
 
     if (priv == NULL)
-        return JS_TRUE; /* we are the prototype, or have the wrong class */
+        return true; /* we are the prototype, or have the wrong class */
 
 
     success = gjs_invoke_c_function(context, priv, object, js_argc, js_argv.array(), &retval, NULL);
@@ -1361,7 +1358,7 @@ function_finalize(JSFreeOp *fop,
     g_slice_free(Function, priv);
 }
 
-static JSBool
+static bool
 get_num_arguments (JSContext *context,
                    JS::HandleObject obj,
                    JS::HandleId id,
@@ -1376,7 +1373,7 @@ get_num_arguments (JSContext *context,
     priv = priv_from_js(context, obj);
 
     if (priv == NULL)
-        return JS_FALSE;
+        return false;
 
     n_args = g_callable_info_get_n_args(priv->info);
     n_jsargs = 0;
@@ -1393,7 +1390,7 @@ get_num_arguments (JSContext *context,
     }
 
     rec.rval().setInt32(n_jsargs);
-    return JS_TRUE;
+    return true;
 }
 
 static JSBool
@@ -1406,7 +1403,7 @@ function_to_string (JSContext *context,
     gboolean free;
     JSObject *self;
     JS::Value retval;
-    JSBool ret = JS_FALSE;
+    bool ret = false;
     int i, n_args, n_jsargs;
     GString *arg_names_str;
     gchar *arg_names;
@@ -1415,7 +1412,7 @@ function_to_string (JSContext *context,
 
     if (rec.thisv().isNull()) {
         gjs_throw(context, "this cannot be null");
-        return JS_FALSE;
+        return false;
     }
     self = &rec.thisv().toObject();
 
@@ -1466,7 +1463,7 @@ function_to_string (JSContext *context,
  out:
     if (gjs_string_from_utf8(context, string, -1, &retval)) {
         rec.rval().set(retval);
-        ret = JS_TRUE;
+        ret = true;
     }
 
     if (free)
@@ -1609,7 +1606,7 @@ init_cached_function_data (JSContext      *context,
                                   g_base_info_get_namespace( (GIBaseInfo*) info),
                                   g_base_info_get_name( (GIBaseInfo*) info));
                         g_base_info_unref(interface_info);
-                        return JS_FALSE;
+                        return false;
                     }
                 }
             }
@@ -1626,7 +1623,7 @@ init_cached_function_data (JSContext      *context,
                         gjs_throw(context, "Function %s.%s has an array with different-direction length arg, 
not supported",
                                   g_base_info_get_namespace( (GIBaseInfo*) info),
                                   g_base_info_get_name( (GIBaseInfo*) info));
-                        return JS_FALSE;
+                        return false;
                     }
 
                     function->param_types[array_length_pos] = PARAM_SKIPPED;
@@ -1656,7 +1653,7 @@ init_cached_function_data (JSContext      *context,
 
     g_base_info_ref((GIBaseInfo*) function->info);
 
-    return JS_TRUE;
+    return true;
 }
 
 static JSObject*
@@ -1783,7 +1780,7 @@ gjs_define_function(JSContext      *context,
 }
 
 
-JSBool
+bool
 gjs_invoke_c_function_uncached (JSContext      *context,
                                 GIFunctionInfo *info,
                                 JSObject       *obj,
@@ -1792,18 +1789,18 @@ gjs_invoke_c_function_uncached (JSContext      *context,
                                 JS::Value      *rval)
 {
   Function function;
-  JSBool result;
+  bool result;
 
   memset (&function, 0, sizeof (Function));
   if (!init_cached_function_data (context, &function, 0, info))
-    return JS_FALSE;
+      return false;
 
   result = gjs_invoke_c_function (context, &function, obj, argc, argv, rval, NULL);
   uninit_cached_function_data (&function);
   return result;
 }
 
-JSBool
+bool
 gjs_invoke_constructor_from_c (JSContext      *context,
                                JSObject       *constructor,
                                JSObject       *obj,
diff --git a/gi/function.h b/gi/function.h
index 0eaf26b..14f5453 100644
--- a/gi/function.h
+++ b/gi/function.h
@@ -66,14 +66,14 @@ JSObject* gjs_define_function   (JSContext      *context,
                                  GType           gtype,
                                  GICallableInfo *info);
 
-JSBool    gjs_invoke_c_function_uncached (JSContext      *context,
+bool      gjs_invoke_c_function_uncached (JSContext      *context,
                                           GIFunctionInfo *info,
                                           JSObject       *obj,
                                           unsigned        argc,
                                           JS::Value      *argv,
                                           JS::Value      *rval);
 
-JSBool    gjs_invoke_constructor_from_c (JSContext      *context,
+bool      gjs_invoke_constructor_from_c (JSContext      *context,
                                          JSObject       *constructor,
                                          JSObject       *obj,
                                          unsigned        argc,
diff --git a/gi/fundamental.cpp b/gi/fundamental.cpp
index 68d0c40..43c191d 100644
--- a/gi/fundamental.cpp
+++ b/gi/fundamental.cpp
@@ -225,7 +225,7 @@ find_fundamental_constructor(JSContext    *context,
 
 /**/
 
-static JSBool
+static bool
 fundamental_instance_new_resolve_interface(JSContext    *context,
                                            JS::HandleObject obj,
                                            JS::MutableHandleObject objp,
@@ -233,12 +233,12 @@ fundamental_instance_new_resolve_interface(JSContext    *context,
                                            char         *name)
 {
     GIFunctionInfo *method_info;
-    JSBool ret;
+    bool ret;
     GType *interfaces;
     guint n_interfaces;
     guint i;
 
-    ret = JS_TRUE;
+    ret = true;
     interfaces = g_type_interfaces(proto_priv->gtype, &n_interfaces);
     for (i = 0; i < n_interfaces; i++) {
         GIBaseInfo *base_info;
@@ -267,7 +267,7 @@ fundamental_instance_new_resolve_interface(JSContext    *context,
                                         (GICallableInfo *) method_info)) {
                     objp.set(obj);
                 } else {
-                    ret = JS_FALSE;
+                    ret = false;
                 }
             }
 
@@ -292,7 +292,7 @@ fundamental_instance_new_resolve_interface(JSContext    *context,
  * was not resolved; and non-null, referring to obj or one of its prototypes,
  * if id was resolved.
  */
-static JSBool
+static bool
 fundamental_instance_new_resolve(JSContext  *context,
                                  JS::HandleObject obj,
                                  JS::HandleId id,
@@ -301,10 +301,10 @@ fundamental_instance_new_resolve(JSContext  *context,
 {
     FundamentalInstance *priv;
     char *name;
-    JSBool ret = JS_FALSE;
+    bool ret = false;
 
     if (!gjs_get_string_id(context, id, &name))
-        return JS_TRUE; /* not resolved, but no error */
+        return true; /* not resolved, but no error */
 
     priv = priv_from_js(context, obj);
     gjs_debug_jsprop(GJS_DEBUG_GFUNDAMENTAL,
@@ -339,7 +339,7 @@ fundamental_instance_new_resolve(JSContext  *context,
                               g_base_info_get_namespace((GIBaseInfo *) proto_priv->info),
                               g_base_info_get_name((GIBaseInfo *) proto_priv->info));
                     g_base_info_unref((GIBaseInfo *) method_info);
-                    ret = JS_TRUE;
+                    ret = true;
                     goto out;
                 }
 
@@ -373,13 +373,13 @@ fundamental_instance_new_resolve(JSContext  *context,
          */
     }
 
-    ret = JS_TRUE;
+    ret = true;
  out:
     g_free(name);
     return ret;
 }
 
-static JSBool
+static bool
 fundamental_invoke_constructor(FundamentalInstance *priv,
                                JSContext           *context,
                                JSObject            *obj,
@@ -389,7 +389,7 @@ fundamental_invoke_constructor(FundamentalInstance *priv,
 {
     JS::Value js_constructor, js_constructor_func;
     jsid constructor_const;
-    JSBool ret = JS_FALSE;
+    bool ret = false;
 
     constructor_const = gjs_context_get_const_string(context, GJS_STRING_CONSTRUCTOR);
     if (!gjs_object_require_property(context, obj, NULL,
@@ -441,7 +441,7 @@ GJS_NATIVE_CONSTRUCTOR_DECLARE(fundamental_instance)
                         object, priv);
 
     if (!fundamental_invoke_constructor(priv, context, object, argc, argv.array(), &ret_value))
-        return JS_FALSE;
+        return false;
 
     associate_js_instance_to_fundamental(context, object, ret_value.v_pointer, FALSE);
 
@@ -451,11 +451,11 @@ GJS_NATIVE_CONSTRUCTOR_DECLARE(fundamental_instance)
                                  g_callable_info_get_caller_owns((GICallableInfo*) 
priv->prototype->constructor_info),
                                  &return_info,
                                  &ret_value))
-        return JS_FALSE;
+        return false;
 
     GJS_NATIVE_CONSTRUCTOR_FINISH(fundamental_instance);
 
-    return JS_TRUE;
+    return true;
 }
 
 static void
@@ -495,7 +495,7 @@ fundamental_finalize(JSFreeOp  *fop,
     }
 }
 
-static JSBool
+static bool
 to_string_func(JSContext *context,
                unsigned   argc,
                JS::Value *vp)
@@ -504,7 +504,7 @@ to_string_func(JSContext *context,
     JSObject *obj = rec.thisv().toObjectOrNull();
 
     FundamentalInstance *priv;
-    JSBool ret = JS_FALSE;
+    bool ret = false;
     JS::Value retval;
 
     if (!priv_from_js_with_typecheck(context, obj, &priv))
@@ -528,7 +528,7 @@ to_string_func(JSContext *context,
             goto out;
     }
 
-    ret = JS_TRUE;
+    ret = true;
     rec.rval().set(retval);
  out:
     return ret;
@@ -640,7 +640,7 @@ gjs_lookup_fundamental_prototype_from_gtype(JSContext *context,
     return proto;
 }
 
-JSBool
+bool
 gjs_define_fundamental_class(JSContext     *context,
                              JSObject      *in_object,
                              GIObjectInfo  *info,
@@ -744,7 +744,7 @@ gjs_define_fundamental_class(JSContext     *context,
     if (prototype_p)
         *prototype_p = prototype;
 
-    return JS_TRUE;
+    return true;
 }
 
 JSObject*
@@ -839,25 +839,25 @@ gjs_g_fundamental_from_object(JSContext *context,
     return priv->gfundamental;
 }
 
-JSBool
+bool
 gjs_typecheck_is_fundamental(JSContext     *context,
                              JSObject      *object,
-                             JSBool         throw_error)
+                             bool           throw_error)
 {
     return do_base_typecheck(context, object, throw_error);
 }
 
-JSBool
+bool
 gjs_typecheck_fundamental(JSContext *context,
                           JSObject  *object,
                           GType      expected_gtype,
-                          JSBool     throw_error)
+                          bool       throw_error)
 {
     FundamentalInstance *priv;
-    JSBool result;
+    bool result;
 
     if (!do_base_typecheck(context, object, throw_error))
-        return JS_FALSE;
+        return false;
 
     priv = priv_from_js(context, object);
     g_assert(priv != NULL);
@@ -871,13 +871,13 @@ gjs_typecheck_fundamental(JSContext *context,
                       proto_priv->info ? g_base_info_get_name((GIBaseInfo *) proto_priv->info) : 
g_type_name(proto_priv->gtype));
         }
 
-        return JS_FALSE;
+        return false;
     }
 
     if (expected_gtype != G_TYPE_NONE)
         result = g_type_is_a(priv->prototype->gtype, expected_gtype);
     else
-        result = JS_TRUE;
+        result = true;
 
     if (!result && throw_error) {
         if (priv->prototype->info) {
diff --git a/gi/fundamental.h b/gi/fundamental.h
index 50e1086..5098912 100644
--- a/gi/fundamental.h
+++ b/gi/fundamental.h
@@ -31,7 +31,7 @@
 
 G_BEGIN_DECLS
 
-JSBool gjs_define_fundamental_class          (JSContext     *context,
+bool      gjs_define_fundamental_class       (JSContext     *context,
                                               JSObject      *in_object,
                                               GIObjectInfo  *info,
                                               JSObject     **constructor_p,
@@ -44,13 +44,13 @@ void*     gjs_g_fundamental_from_object      (JSContext     *context,
 JSObject *gjs_fundamental_from_g_value       (JSContext     *context,
                                               const GValue  *value,
                                               GType          gtype);
-JSBool    gjs_typecheck_fundamental          (JSContext     *context,
+bool      gjs_typecheck_fundamental          (JSContext     *context,
                                               JSObject      *object,
                                               GType          expected_gtype,
-                                              JSBool         throw_error);
-JSBool    gjs_typecheck_is_fundamental       (JSContext     *context,
+                                              bool           throw_error);
+bool      gjs_typecheck_is_fundamental       (JSContext     *context,
                                               JSObject      *object,
-                                              JSBool         throw_error);
+                                              bool           throw_error);
 void*     gjs_fundamental_ref                (JSContext     *context,
                                               void          *fobj);
 void      gjs_fundamental_unref              (JSContext     *context,
diff --git a/gi/gerror.cpp b/gi/gerror.cpp
index 6b9c88e..fcb4aa6 100644
--- a/gi/gerror.cpp
+++ b/gi/gerror.cpp
@@ -68,7 +68,7 @@ GJS_NATIVE_CONSTRUCTOR_DECLARE(error)
     /* Check early to avoid allocating memory for nothing */
     if (argc != 1 || !argv[0].isObject()) {
         gjs_throw(context, "Invalid parameters passed to GError constructor, expected one object");
-        return JS_FALSE;
+        return false;
     }
 
     GJS_NATIVE_CONSTRUCTOR_PRELUDE(error);
@@ -95,7 +95,7 @@ GJS_NATIVE_CONSTRUCTOR_DECLARE(error)
     if (proto_priv == NULL) {
         gjs_debug(GJS_DEBUG_GERROR,
                   "Bad prototype set on GError? Must match JSClass of object. JS error should have been 
reported.");
-        return JS_FALSE;
+        return false;
     }
 
     priv->info = proto_priv->info;
@@ -106,12 +106,12 @@ GJS_NATIVE_CONSTRUCTOR_DECLARE(error)
     code_name = gjs_context_get_const_string(context, GJS_STRING_CODE);
     if (!gjs_object_require_property(context, &argv[0].toObject(),
                                      "GError constructor", message_name, &v_message))
-        return JS_FALSE;
+        return false;
     if (!gjs_object_require_property(context, &argv[0].toObject(),
                                      "GError constructor", code_name, &v_code))
-        return JS_FALSE;
+        return false;
     if (!gjs_string_to_utf8 (context, v_message, &message))
-        return JS_FALSE;
+        return false;
 
     priv->gerror = g_error_new_literal(priv->domain, v_code.toInt32(),
                                        message);
@@ -123,7 +123,7 @@ GJS_NATIVE_CONSTRUCTOR_DECLARE(error)
 
     GJS_NATIVE_CONSTRUCTOR_FINISH(boxed);
 
-    return JS_TRUE;
+    return true;
 }
 
 static void
@@ -149,7 +149,7 @@ error_finalize(JSFreeOp *fop,
     g_slice_free(Error, priv);
 }
 
-static JSBool
+static bool
 error_get_domain(JSContext *context, JS::HandleObject obj,
                  JS::HandleId id, JS::MutableHandleValue vp)
 {
@@ -158,13 +158,13 @@ error_get_domain(JSContext *context, JS::HandleObject obj,
     priv = priv_from_js(context, obj);
 
     if (priv == NULL)
-        return JS_FALSE;
+        return false;
 
     vp.setInt32(priv->domain);
-    return JS_TRUE;
+    return true;
 }
 
-static JSBool
+static bool
 error_get_message(JSContext *context, JS::HandleObject obj,
                   JS::HandleId id, JS::MutableHandleValue vp)
 {
@@ -173,18 +173,18 @@ error_get_message(JSContext *context, JS::HandleObject obj,
     priv = priv_from_js(context, obj);
 
     if (priv == NULL)
-        return JS_FALSE;
+        return false;
 
     if (priv->gerror == NULL) {
         /* Object is prototype, not instance */
         gjs_throw(context, "Can't get a field from a GError prototype");
-        return JS_FALSE;
+        return false;
     }
 
     return gjs_string_from_utf8(context, priv->gerror->message, -1, vp.address());
 }
 
-static JSBool
+static bool
 error_get_code(JSContext *context, JS::HandleObject obj,
                JS::HandleId id, JS::MutableHandleValue vp)
 {
@@ -193,19 +193,19 @@ error_get_code(JSContext *context, JS::HandleObject obj,
     priv = priv_from_js(context, obj);
 
     if (priv == NULL)
-        return JS_FALSE;
+        return false;
 
     if (priv->gerror == NULL) {
         /* Object is prototype, not instance */
         gjs_throw(context, "Can't get a field from a GError prototype");
-        return JS_FALSE;
+        return false;
     }
 
     vp.setInt32(priv->gerror->code);
-    return JS_TRUE;
+    return true;
 }
 
-static JSBool
+static bool
 error_to_string(JSContext *context,
                 unsigned   argc,
                 JS::Value *vp)
@@ -215,24 +215,24 @@ error_to_string(JSContext *context,
     Error *priv;
     JS::Value v_out;
     gchar *descr;
-    JSBool retval;
+    bool retval;
 
     JS::CallReceiver rec = JS::CallReceiverFromVp(vp);
     v_self = rec.thisv();
     if (!v_self.isObject()) {
         /* Lie a bit here... */
         gjs_throw(context, "GLib.Error.prototype.toString() called on a non object");
-        return JS_FALSE;
+        return false;
     }
 
     self = &v_self.toObject();
     priv = priv_from_js(context, self);
 
     if (priv == NULL)
-        return JS_FALSE;
+        return false;
 
     v_out = JS::UndefinedValue();
-    retval = JS_FALSE;
+    retval = false;
 
     /* We follow the same pattern as standard JS errors, at the expense of
        hiding some useful information */
@@ -255,14 +255,14 @@ error_to_string(JSContext *context,
     }
 
     rec.rval().set(v_out);
-    retval = JS_TRUE;
+    retval = true;
 
  out:
     g_free(descr);
     return retval;
 }
 
-static JSBool
+static bool
 error_constructor_value_of(JSContext *context,
                            unsigned   argc,
                            JS::Value *vp)
@@ -276,27 +276,27 @@ error_constructor_value_of(JSContext *context,
     if (!v_self.isObject()) {
         /* Lie a bit here... */
         gjs_throw(context, "GLib.Error.valueOf() called on a non object");
-        return JS_FALSE;
+        return false;
     }
 
     prototype_name = gjs_context_get_const_string(context, GJS_STRING_PROTOTYPE);
     if (!gjs_object_require_property(context, &v_self.toObject(), "constructor",
                                      prototype_name, &v_prototype))
-        return JS_FALSE;
+        return false;
 
     if (!v_prototype.isObject()) {
         gjs_throw(context, "GLib.Error.valueOf() called on something that is not"
                   " a constructor");
-        return JS_FALSE;
+        return false;
     }
 
     priv = priv_from_js(context, &v_prototype.toObject());
 
     if (priv == NULL)
-        return JS_FALSE;
+        return false;
 
     rec.rval().setInt32(priv->domain);
-    return JS_TRUE;
+    return true;
 }
 
 
@@ -533,7 +533,7 @@ gjs_gerror_from_error(JSContext    *context,
     /* If this is a plain GBoxed (i.e. a GError without metadata),
        delegate marshalling.
     */
-    if (gjs_typecheck_boxed (context, obj, NULL, G_TYPE_ERROR, JS_FALSE))
+    if (gjs_typecheck_boxed (context, obj, NULL, G_TYPE_ERROR, false))
         return (GError*) gjs_c_struct_from_boxed (context, obj);
 
     priv = priv_from_js(context, obj);
@@ -552,12 +552,12 @@ gjs_gerror_from_error(JSContext    *context,
     return priv->gerror;
 }
 
-JSBool
+bool
 gjs_typecheck_gerror (JSContext *context,
                       JSObject  *obj,
-                      JSBool     throw_error)
+                      bool       throw_error)
 {
-    if (gjs_typecheck_boxed (context, obj, NULL, G_TYPE_ERROR, JS_FALSE))
+    if (gjs_typecheck_boxed (context, obj, NULL, G_TYPE_ERROR, false))
         return TRUE;
 
     return do_base_typecheck(context, obj, throw_error);
diff --git a/gi/gerror.h b/gi/gerror.h
index ce25477..38cfa2f 100644
--- a/gi/gerror.h
+++ b/gi/gerror.h
@@ -39,9 +39,9 @@ GError*   gjs_gerror_from_error        (JSContext             *context,
 JSObject* gjs_error_from_gerror        (JSContext             *context,
                                         GError                *gerror,
                                         gboolean               add_stack);
-JSBool    gjs_typecheck_gerror         (JSContext             *context,
+bool      gjs_typecheck_gerror         (JSContext             *context,
                                         JSObject              *obj,
-                                        JSBool                 throw_error);
+                                        bool                   throw_error);
 
 G_END_DECLS
 
diff --git a/gi/gtype.cpp b/gi/gtype.cpp
index ac91d9a..459bec0 100644
--- a/gi/gtype.cpp
+++ b/gi/gtype.cpp
@@ -61,7 +61,7 @@ gjs_gtype_finalize(JSFreeOp *fop,
     g_type_set_qdata(gtype, gjs_get_gtype_wrapper_quark(), NULL);
 }
 
-static JSBool
+static bool
 to_string_func(JSContext *context,
                unsigned   argc,
                JS::Value *vp)
@@ -71,7 +71,7 @@ to_string_func(JSContext *context,
 
     GType gtype;
     gchar *strval;
-    JSBool ret;
+    bool ret;
     JS::Value retval;
 
     gtype = GPOINTER_TO_SIZE(priv_from_js(context, obj));
@@ -88,14 +88,14 @@ to_string_func(JSContext *context,
     return ret;
 }
 
-static JSBool
+static bool
 get_name_func (JSContext *context,
                JS::HandleObject obj,
                JS::HandleId id,
                JS::MutableHandleValue vp)
 {
     GType gtype;
-    JSBool ret;
+    bool ret;
     JS::Value retval;
     JS::CallReceiver rec = JS::CallReceiverFromVp(vp.address());
 
@@ -204,10 +204,10 @@ gjs_gtype_get_actual_gtype (JSContext *context,
     return _gjs_gtype_get_actual_gtype(context, object, 2);
 }
 
-JSBool
+bool
 gjs_typecheck_gtype (JSContext             *context,
                      JSObject              *obj,
-                     JSBool                 throw_error)
+                     bool                   throw_error)
 {
     return do_base_typecheck(context, obj, throw_error);
 }
diff --git a/gi/gtype.h b/gi/gtype.h
index d5fc058..2ff3291 100644
--- a/gi/gtype.h
+++ b/gi/gtype.h
@@ -42,9 +42,9 @@ JSObject * gjs_gtype_create_gtype_wrapper (JSContext *context,
 GType      gjs_gtype_get_actual_gtype (JSContext *context,
                                        JSObject  *object);
 
-JSBool    gjs_typecheck_gtype         (JSContext             *context,
-                                       JSObject              *obj,
-                                       JSBool                 throw_error);
+bool        gjs_typecheck_gtype         (JSContext             *context,
+                                         JSObject              *obj,
+                                         bool                   throw_error);
 
 const char *gjs_get_names_from_gtype_and_gi_info(GType        gtype,
                                                  GIBaseInfo  *info,
diff --git a/gi/interface.cpp b/gi/interface.cpp
index c2b91cd..6b4d264 100644
--- a/gi/interface.cpp
+++ b/gi/interface.cpp
@@ -69,7 +69,7 @@ interface_finalize(JSFreeOp *fop,
     g_slice_free(Interface, priv);
 }
 
-static JSBool
+static bool
 gjs_define_static_methods(JSContext       *context,
                           JSObject        *constructor,
                           GType            gtype,
@@ -101,10 +101,10 @@ gjs_define_static_methods(JSContext       *context,
 
         g_base_info_unref((GIBaseInfo*) meth_info);
     }
-    return JS_TRUE;
+    return true;
 }
 
-static JSBool
+static bool
 interface_new_resolve(JSContext *context,
                       JS::HandleObject obj,
                       JS::HandleId id,
@@ -113,11 +113,11 @@ interface_new_resolve(JSContext *context,
 {
     Interface *priv;
     char *name;
-    JSBool ret = JS_FALSE;
+    bool ret = false;
     GIFunctionInfo *method_info;
 
     if (!gjs_get_string_id(context, id, &name))
-        return JS_TRUE;
+        return true;
 
     priv = priv_from_js(context, obj);
 
@@ -128,7 +128,7 @@ interface_new_resolve(JSContext *context,
      * from within GJS. In that case, it has no properties that need to be
      * resolved from within C code, as interfaces cannot inherit. */
     if (priv->info == NULL) {
-        ret = JS_TRUE;
+        ret = true;
         goto out;
     }
 
@@ -149,7 +149,7 @@ interface_new_resolve(JSContext *context,
         g_base_info_unref((GIBaseInfo*)method_info);
     }
 
-    ret = JS_TRUE;
+    ret = true;
 
  out:
     g_free (name);
@@ -182,7 +182,7 @@ JSFunctionSpec gjs_interface_proto_funcs[] = {
     { NULL }
 };
 
-JSBool
+bool
 gjs_define_interface_class(JSContext       *context,
                            JSObject        *in_object,
                            GIInterfaceInfo *info,
@@ -237,10 +237,10 @@ gjs_define_interface_class(JSContext       *context,
     if (constructor_p)
         *constructor_p = constructor;
 
-    return JS_TRUE;
+    return true;
 }
 
-JSBool
+bool
 gjs_lookup_interface_constructor(JSContext *context,
                                  GType      gtype,
                                  JS::Value *value_p)
@@ -253,7 +253,7 @@ gjs_lookup_interface_constructor(JSContext *context,
     if (interface_info == NULL) {
         gjs_throw(context, "Cannot expose non introspectable interface %s",
                   g_type_name(gtype));
-        return JS_FALSE;
+        return false;
     }
 
     g_assert(g_base_info_get_type(interface_info) ==
@@ -261,10 +261,10 @@ gjs_lookup_interface_constructor(JSContext *context,
 
     constructor = gjs_lookup_generic_constructor(context, interface_info);
     if (G_UNLIKELY (constructor == NULL))
-        return JS_FALSE;
+        return false;
 
     g_base_info_unref(interface_info);
 
     *value_p = JS::ObjectValue(*constructor);
-    return JS_TRUE;
+    return true;
 }
diff --git a/gi/interface.h b/gi/interface.h
index 1390a65..f08d5b5 100644
--- a/gi/interface.h
+++ b/gi/interface.h
@@ -31,15 +31,15 @@
 
 G_BEGIN_DECLS
 
-JSBool gjs_define_interface_class (JSContext       *context,
-                                   JSObject        *in_object,
-                                   GIInterfaceInfo *info,
-                                   GType            gtype,
-                                   JSObject       **constructor_p);
+bool gjs_define_interface_class (JSContext       *context,
+                                 JSObject        *in_object,
+                                 GIInterfaceInfo *info,
+                                 GType            gtype,
+                                 JSObject       **constructor_p);
 
-JSBool gjs_lookup_interface_constructor (JSContext     *context,
-                                         GType          gtype,
-                                         JS::Value     *value_p);
+bool gjs_lookup_interface_constructor (JSContext     *context,
+                                       GType          gtype,
+                                       JS::Value     *value_p);
 
 G_END_DECLS
 
diff --git a/gi/ns.cpp b/gi/ns.cpp
index 1c2c499..376f322 100644
--- a/gi/ns.cpp
+++ b/gi/ns.cpp
@@ -55,7 +55,7 @@ GJS_DEFINE_PRIV_FROM_JS(Ns, gjs_ns_class)
  * was not resolved; and non-null, referring to obj or one of its prototypes,
  * if id was resolved.
  */
-static JSBool
+static bool
 ns_new_resolve(JSContext *context,
                JS::HandleObject obj,
                JS::HandleId id,
@@ -66,16 +66,16 @@ ns_new_resolve(JSContext *context,
     char *name;
     GIRepository *repo;
     GIBaseInfo *info;
-    JSBool ret = JS_FALSE;
+    bool ret = false;
     gboolean defined;
 
     if (!gjs_get_string_id(context, id, &name))
-        return JS_TRUE; /* not resolved, but no error */
+        return true; /* not resolved, but no error */
 
     /* let Object.prototype resolve these */
     if (strcmp(name, "valueOf") == 0 ||
         strcmp(name, "toString") == 0) {
-        ret = JS_TRUE;
+        ret = true;
         goto out;
     }
 
@@ -85,7 +85,7 @@ ns_new_resolve(JSContext *context,
                      name, (void *)obj, priv);
 
     if (priv == NULL) {
-        ret = JS_TRUE; /* we are the prototype, or have the wrong class */
+        ret = true; /* we are the prototype, or have the wrong class */
         goto out;
     }
 
@@ -97,7 +97,7 @@ ns_new_resolve(JSContext *context,
     if (info == NULL) {
         /* No property defined, but no error either, so return TRUE */
         JS_EndRequest(context);
-        ret = JS_TRUE;
+        ret = true;
         goto out;
     }
 
@@ -111,7 +111,7 @@ ns_new_resolve(JSContext *context,
         g_base_info_unref(info);
         if (defined)
             objp.set(obj); /* we defined the property in this object */
-        ret = JS_TRUE;
+        ret = true;
     } else {
         gjs_debug(GJS_DEBUG_GNAMESPACE,
                   "Failed to define info '%s'",
@@ -126,7 +126,7 @@ ns_new_resolve(JSContext *context,
     return ret;
 }
 
-static JSBool
+static bool
 get_name (JSContext *context,
           JS::HandleObject obj,
           JS::HandleId id,
@@ -134,7 +134,7 @@ get_name (JSContext *context,
 {
     Ns *priv;
     JS::Value retval;
-    JSBool ret = JS_FALSE;
+    bool ret = false;
 
     priv = priv_from_js(context, obj);
 
@@ -143,7 +143,7 @@ get_name (JSContext *context,
 
     if (gjs_string_from_utf8(context, priv->gi_namespace, -1, &retval)) {
         *vp = retval;
-        ret = JS_TRUE;
+        ret = true;
     }
 
  out:
diff --git a/gi/object.cpp b/gi/object.cpp
index cfca5d3..4b1e16b 100644
--- a/gi/object.cpp
+++ b/gi/object.cpp
@@ -103,7 +103,7 @@ static void            set_js_obj   (GObject   *gobj,
 static void            disassociate_js_gobject (GObject *gobj);
 static void            invalidate_all_signals (ObjectInstance *priv);
 typedef enum {
-    SOME_ERROR_OCCURRED = JS_FALSE,
+    SOME_ERROR_OCCURRED = false,
     NO_SUCH_G_PROPERTY,
     VALUE_WAS_SET
 } ValueFromPropertyResult;
@@ -248,7 +248,7 @@ proto_priv_from_js(JSContext *context,
 }
 
 /* a hook on getting a property; set value_p to override property's value.
- * Return value is JS_FALSE on OOM/exception.
+ * Return value is false on OOM/exception.
  */
 static JSBool
 object_instance_get_prop(JSContext              *context,
@@ -261,10 +261,10 @@ object_instance_get_prop(JSContext              *context,
     char *gname;
     GParamSpec *param;
     GValue gvalue = { 0, };
-    JSBool ret = JS_TRUE;
+    bool ret = true;
 
     if (!gjs_get_string_id(context, id, &name))
-        return JS_TRUE; /* not resolved, but no error */
+        return true; /* not resolved, but no error */
 
     priv = priv_from_js(context, obj);
     gjs_debug_jsprop(GJS_DEBUG_GOBJECT,
@@ -307,7 +307,7 @@ object_instance_get_prop(JSContext              *context,
                           &gvalue);
     if (!gjs_value_from_g_value(context, value_p.address(), &gvalue)) {
         g_value_unset(&gvalue);
-        ret = JS_FALSE;
+        ret = false;
         goto out;
     }
     g_value_unset(&gvalue);
@@ -318,7 +318,7 @@ object_instance_get_prop(JSContext              *context,
 }
 
 /* a hook on setting a property; set value_p to override property value to
- * be set. Return value is JS_FALSE on OOM/exception.
+ * be set. Return value is false on OOM/exception.
  */
 static JSBool
 object_instance_set_prop(JSContext              *context,
@@ -330,10 +330,10 @@ object_instance_set_prop(JSContext              *context,
     ObjectInstance *priv;
     char *name;
     GParameter param = { NULL, { 0, }};
-    JSBool ret = JS_TRUE;
+    bool ret = true;
 
     if (!gjs_get_string_id(context, id, &name))
-        return JS_TRUE; /* not resolved, but no error */
+        return true; /* not resolved, but no error */
 
     priv = priv_from_js(context, obj);
     gjs_debug_jsprop(GJS_DEBUG_GOBJECT,
@@ -353,7 +353,7 @@ object_instance_set_prop(JSContext              *context,
                                        &param,
                                        FALSE /* constructing */)) {
     case SOME_ERROR_OCCURRED:
-        ret = JS_FALSE;
+        ret = false;
     case NO_SUCH_G_PROPERTY:
         goto out;
     case VALUE_WAS_SET:
@@ -436,7 +436,7 @@ find_vfunc_on_parents(GIObjectInfo *info,
     return vfunc;
 }
 
-static JSBool
+static bool
 object_instance_new_resolve_no_info(JSContext       *context,
                                     JS::HandleObject obj,
                                     JS::MutableHandleObject objp,
@@ -444,12 +444,12 @@ object_instance_new_resolve_no_info(JSContext       *context,
                                     char            *name)
 {
     GIFunctionInfo *method_info;
-    JSBool ret;
+    bool ret;
     GType *interfaces;
     guint n_interfaces;
     guint i;
 
-    ret = JS_TRUE;
+    ret = true;
     interfaces = g_type_interfaces(priv->gtype, &n_interfaces);
     for (i = 0; i < n_interfaces; i++) {
         GIBaseInfo *base_info;
@@ -477,7 +477,7 @@ object_instance_new_resolve_no_info(JSContext       *context,
                                         (GICallableInfo *)method_info)) {
                     objp.set(obj);
                 } else {
-                    ret = JS_FALSE;
+                    ret = false;
                 }
             }
 
@@ -502,7 +502,7 @@ object_instance_new_resolve_no_info(JSContext       *context,
  * was not resolved; and non-null, referring to obj or one of its prototypes,
  * if id was resolved.
  */
-static JSBool
+static bool
 object_instance_new_resolve(JSContext *context,
                             JS::HandleObject obj,
                             JS::HandleId id,
@@ -512,10 +512,10 @@ object_instance_new_resolve(JSContext *context,
     GIFunctionInfo *method_info;
     ObjectInstance *priv;
     char *name;
-    JSBool ret = JS_FALSE;
+    bool ret = false;
 
     if (!gjs_get_string_id(context, id, &name))
-        return JS_TRUE; /* not resolved, but no error */
+        return true; /* not resolved, but no error */
 
     priv = priv_from_js(context, obj);
 
@@ -538,12 +538,12 @@ object_instance_new_resolve(JSContext *context,
          * will run afterwards will fail because of the "priv == NULL"
          * check there.
          */
-        ret = JS_TRUE;
+        ret = true;
         goto out;
     }
 
     if (priv->gobj != NULL) {
-        ret = JS_TRUE;
+        ret = true;
         goto out;
     }
 
@@ -580,14 +580,14 @@ object_instance_new_resolve(JSContext *context,
              * prototypal inheritance take over. */
             if (defined_by_parent && is_vfunc_unchanged(vfunc, priv->gtype)) {
                 g_base_info_unref((GIBaseInfo *)vfunc);
-                ret = JS_TRUE;
+                ret = true;
                 goto out;
             }
 
             gjs_define_function(context, obj, priv->gtype, vfunc);
             objp.set(obj);
             g_base_info_unref((GIBaseInfo *)vfunc);
-            ret = JS_TRUE;
+            ret = true;
             goto out;
         }
 
@@ -643,7 +643,7 @@ object_instance_new_resolve(JSContext *context,
         g_base_info_unref( (GIBaseInfo*) method_info);
     }
 
-    ret = JS_TRUE;
+    ret = true;
  out:
     g_free(name);
     return ret;
@@ -664,7 +664,7 @@ free_g_params(GParameter *params,
 /* Set properties from args to constructor (argv[0] is supposed to be
  * a hash)
  */
-static JSBool
+static bool
 object_instance_props_to_g_parameters(JSContext   *context,
                                       JSObject    *obj,
                                       unsigned     argc,
@@ -748,7 +748,7 @@ object_instance_props_to_g_parameters(JSContext   *context,
     if (gparams_p)
         *gparams_p = (GParameter*) g_array_free(gparams, FALSE);
 
-    return JS_TRUE;
+    return true;
 
  free_array_and_fail:
     {
@@ -758,7 +758,7 @@ object_instance_props_to_g_parameters(JSContext   *context,
         to_free = (GParameter*) g_array_free(gparams, FALSE);
         free_g_params(to_free, count);
     }
-    return JS_FALSE;
+    return false;
 }
 
 #define DEBUG_DISPOSE 0
@@ -1239,7 +1239,7 @@ disassociate_js_gobject (GObject   *gobj)
 #endif
 }
 
-static JSBool
+static bool
 object_instance_init (JSContext *context,
                       JSObject **object,
                       unsigned   argc,
@@ -1261,7 +1261,7 @@ object_instance_init (JSContext *context,
     if (!object_instance_props_to_g_parameters(context, *object, argc, argv,
                                                gtype,
                                                &params, &n_params)) {
-        return JS_FALSE;
+        return false;
     }
 
     /* Mark this object in the construction stack, it
@@ -1328,13 +1328,13 @@ object_instance_init (JSContext *context,
                                priv->info ? g_base_info_get_name((GIBaseInfo*) priv->info) : 
g_type_name(gtype)));
 
  out:
-    return JS_TRUE;
+    return true;
 }
 
 GJS_NATIVE_CONSTRUCTOR_DECLARE(object_instance)
 {
     GJS_NATIVE_CONSTRUCTOR_VARIABLES(object_instance)
-    JSBool ret;
+    bool ret;
     JS::Value initer;
     JS::Value rval;
     jsid object_init_name;
@@ -1348,7 +1348,7 @@ GJS_NATIVE_CONSTRUCTOR_DECLARE(object_instance)
 
     object_init_name = gjs_context_get_const_string(context, GJS_STRING_GOBJECT_INIT);
     if (!gjs_object_require_property(context, object, "GObject instance", object_init_name, &initer))
-        return JS_FALSE;
+        return false;
 
     rval.setUndefined();
     ret = gjs_call_function_value(context, object, initer, argc, argv.array(), &rval);
@@ -1557,7 +1557,7 @@ signal_connection_invalidated (gpointer  user_data,
     g_slice_free(ConnectData, connect_data);
 }
 
-static JSBool
+static bool
 real_connect_func(JSContext *context,
                   unsigned   argc,
                   JS::Value *vp,
@@ -1573,23 +1573,23 @@ real_connect_func(JSContext *context,
     char *signal_name;
     GQuark signal_detail;
     ConnectData *connect_data;
-    JSBool ret = JS_FALSE;
+    bool ret = false;
 
-    if (!do_base_typecheck(context, obj, JS_TRUE))
-        return JS_FALSE;
+    if (!do_base_typecheck(context, obj, true))
+        return false;
 
     priv = priv_from_js(context, obj);
     gjs_debug_gsignal("connect obj %p priv %p argc %d", obj, priv, argc);
     if (priv == NULL) {
         throw_priv_is_null_error(context);
-        return JS_FALSE; /* wrong class passed in */
+        return false; /* wrong class passed in */
     }
     if (priv->gobj == NULL) {
         /* prototype, not an instance. */
         gjs_throw(context, "Can't connect to signals on %s.%s.prototype; only on instances",
                   priv->info ? g_base_info_get_namespace( (GIBaseInfo*) priv->info) : "",
                   priv->info ? g_base_info_get_name( (GIBaseInfo*) priv->info) : g_type_name(priv->gtype));
-        return JS_FALSE;
+        return false;
     }
 
     /* Best I can tell, there is no way to know if argv[1] is really
@@ -1600,11 +1600,11 @@ real_connect_func(JSContext *context,
 
     if (argc != 2 || !argv[0].isString() || !argv[1].isObject()) {
         gjs_throw(context, "connect() takes two args, the signal name and the callback");
-        return JS_FALSE;
+        return false;
     }
 
     if (!gjs_string_to_utf8(context, argv[0], &signal_name)) {
-        return JS_FALSE;
+        return false;
     }
 
     if (!g_signal_parse_name(signal_name,
@@ -1638,13 +1638,13 @@ real_connect_func(JSContext *context,
 
     argv.rval().setDouble(id);
 
-    ret = JS_TRUE;
+    ret = true;
  out:
     g_free(signal_name);
     return ret;
 }
 
-static JSBool
+static bool
 connect_after_func(JSContext *context,
                    unsigned   argc,
                    JS::Value *vp)
@@ -1652,7 +1652,7 @@ connect_after_func(JSContext *context,
     return real_connect_func(context, argc, vp, TRUE);
 }
 
-static JSBool
+static bool
 connect_func(JSContext *context,
              unsigned   argc,
              JS::Value *vp)
@@ -1660,7 +1660,7 @@ connect_func(JSContext *context,
     return real_connect_func(context, argc, vp, FALSE);
 }
 
-static JSBool
+static bool
 emit_func(JSContext *context,
           unsigned   argc,
           JS::Value *vp)
@@ -1678,17 +1678,17 @@ emit_func(JSContext *context,
     unsigned int i;
     gboolean failed;
     JS::Value retval;
-    JSBool ret = JS_FALSE;
+    bool ret = false;
 
-    if (!do_base_typecheck(context, obj, JS_TRUE))
-        return JS_FALSE;
+    if (!do_base_typecheck(context, obj, true))
+        return false;
 
     priv = priv_from_js(context, obj);
     gjs_debug_gsignal("emit obj %p priv %p argc %d", obj, priv, argc);
 
     if (priv == NULL) {
         throw_priv_is_null_error(context);
-        return JS_FALSE; /* wrong class passed in */
+        return false; /* wrong class passed in */
     }
 
     if (priv->gobj == NULL) {
@@ -1696,16 +1696,16 @@ emit_func(JSContext *context,
         gjs_throw(context, "Can't emit signal on %s.%s.prototype; only on instances",
                   priv->info ? g_base_info_get_namespace( (GIBaseInfo*) priv->info) : "",
                   priv->info ? g_base_info_get_name( (GIBaseInfo*) priv->info) : g_type_name(priv->gtype));
-        return JS_FALSE;
+        return false;
     }
 
     if (argc < 1 || !argv[0].isString()) {
         gjs_throw(context, "emit() first arg is the signal name");
-        return JS_FALSE;
+        return false;
     }
 
     if (!gjs_string_to_utf8(context, argv[0], &signal_name))
-        return JS_FALSE;
+        return false;
 
     if (!g_signal_parse_name(signal_name,
                              G_OBJECT_TYPE(priv->gobj),
@@ -1783,7 +1783,7 @@ emit_func(JSContext *context,
     return ret;
 }
 
-static JSBool
+static bool
 to_string_func(JSContext *context,
                unsigned   argc,
                JS::Value *vp)
@@ -1792,10 +1792,10 @@ to_string_func(JSContext *context,
     JSObject *obj = rec.thisv().toObjectOrNull();
 
     ObjectInstance *priv;
-    JSBool ret = JS_FALSE;
+    bool ret = false;
     JS::Value retval;
 
-    if (!do_base_typecheck(context, obj, JS_TRUE))
+    if (!do_base_typecheck(context, obj, true))
         goto out;
 
     priv = priv_from_js(context, obj);
@@ -1809,7 +1809,7 @@ to_string_func(JSContext *context,
                                    priv->gtype, priv->gobj, &retval))
         goto out;
 
-    ret = JS_TRUE;
+    ret = true;
     rec.rval().set(retval);
  out:
     return ret;
@@ -1835,7 +1835,7 @@ struct JSClass gjs_object_instance_class = {
     
 };
 
-static JSBool
+static bool
 init_func (JSContext *context,
            unsigned   argc,
            JS::Value *vp)
@@ -1843,7 +1843,7 @@ init_func (JSContext *context,
     JS::CallArgs argv = JS::CallArgsFromVp (argc, vp);
     JSObject *obj = argv.thisv().toObjectOrNull();
 
-    JSBool ret;
+    bool ret;
 
     if (!do_base_typecheck(context, obj, TRUE))
         return FALSE;
@@ -1869,7 +1869,7 @@ JSFunctionSpec gjs_object_instance_proto_funcs[] = {
     { NULL }
 };
 
-JSBool
+bool
 gjs_object_define_static_methods(JSContext    *context,
                                  JSObject     *constructor,
                                  GType         gtype,
@@ -1906,7 +1906,7 @@ gjs_object_define_static_methods(JSContext    *context,
     gtype_struct = g_object_info_get_class_struct(object_info);
 
     if (gtype_struct == NULL)
-        return JS_TRUE;
+        return true;
 
     n_methods = g_struct_info_get_n_methods(gtype_struct);
 
@@ -1922,7 +1922,7 @@ gjs_object_define_static_methods(JSContext    *context,
     }
 
     g_base_info_unref((GIBaseInfo*) gtype_struct);
-    return JS_TRUE;
+    return true;
 }
 
 void
@@ -2116,25 +2116,25 @@ gjs_g_object_from_object(JSContext    *context,
     return priv->gobj;
 }
 
-JSBool
+bool
 gjs_typecheck_is_object(JSContext     *context,
                         JSObject      *object,
-                        JSBool         throw_error)
+                        bool           throw_error)
 {
     return do_base_typecheck(context, object, throw_error);
 }
 
-JSBool
+bool
 gjs_typecheck_object(JSContext     *context,
                      JSObject      *object,
                      GType          expected_type,
-                     JSBool         throw_error)
+                     bool           throw_error)
 {
     ObjectInstance *priv;
-    JSBool result;
+    bool result;
 
     if (!do_base_typecheck(context, object, throw_error))
-        return JS_FALSE;
+        return false;
 
     priv = priv_from_js(context, object);
 
@@ -2145,7 +2145,7 @@ gjs_typecheck_object(JSContext     *context,
                       "Did you forget to chain-up from _init()?");
         }
 
-        return JS_FALSE;
+        return false;
     }
 
     if (priv->gobj == NULL) {
@@ -2156,7 +2156,7 @@ gjs_typecheck_object(JSContext     *context,
                       priv->info ? g_base_info_get_name( (GIBaseInfo*) priv->info) : 
g_type_name(priv->gtype));
         }
 
-        return JS_FALSE;
+        return false;
     }
 
     g_assert(priv->gtype == G_OBJECT_TYPE(priv->gobj));
@@ -2164,7 +2164,7 @@ gjs_typecheck_object(JSContext     *context,
     if (expected_type != G_TYPE_NONE)
         result = g_type_is_a (priv->gtype, expected_type);
     else
-        result = JS_TRUE;
+        result = true;
 
     if (!result && throw_error) {
         if (priv->info) {
@@ -2260,7 +2260,7 @@ find_vfunc_info (JSContext *context,
     g_base_info_unref(struct_info);
 }
 
-static JSBool
+static bool
 gjs_hook_up_vfunc(JSContext *cx,
                   unsigned   argc,
                   JS::Value *vp)
@@ -2281,10 +2281,10 @@ gjs_hook_up_vfunc(JSContext *cx,
                         "object", &object,
                         "name", &name,
                         "function", &function))
-        return JS_FALSE;
+        return false;
 
-    if (!do_base_typecheck(cx, object, JS_TRUE))
-        return JS_FALSE;
+    if (!do_base_typecheck(cx, object, true))
+        return false;
 
     priv = priv_from_js(cx, object);
     gtype = priv->gtype;
@@ -2336,7 +2336,7 @@ gjs_hook_up_vfunc(JSContext *cx,
         gjs_throw(cx, "Could not find definition of virtual function %s", name);
 
         g_free(name);
-        return JS_FALSE;
+        return false;
     }
 
     find_vfunc_info(cx, gtype, vfunc, name, &implementor_vtable, &field_info);
@@ -2369,7 +2369,7 @@ gjs_hook_up_vfunc(JSContext *cx,
 
     g_base_info_unref(vfunc);
     g_free(name);
-    return JS_TRUE;
+    return true;
 }
 
 static gchar *
@@ -2514,7 +2514,7 @@ gjs_object_set_gproperty (GObject      *object,
     jsobj_set_gproperty(context, js_obj, value, pspec);
 }
 
-static JSBool
+static bool
 gjs_override_property(JSContext *cx,
                       unsigned   argc,
                       JS::Value *vp)
@@ -2529,12 +2529,12 @@ gjs_override_property(JSContext *cx,
     if (!gjs_parse_call_args(cx, "override_property", "so", args,
                              "name", &name,
                              "type", &type))
-        return JS_FALSE;
+        return false;
 
     if ((gtype = gjs_gtype_get_actual_gtype(cx, type)) == G_TYPE_INVALID) {
         gjs_throw(cx, "Invalid parameter type was not a GType");
         g_clear_pointer(&name, g_free);
-        return JS_FALSE;
+        return false;
     }
 
     if (g_type_is_a(gtype, G_TYPE_INTERFACE)) {
@@ -2552,7 +2552,7 @@ gjs_override_property(JSContext *cx,
         gjs_throw(cx, "No such property '%s' to override on type '%s'", name,
                   g_type_name(gtype));
         g_clear_pointer(&name, g_free);
-        return JS_FALSE;
+        return false;
     }
 
     new_pspec = g_param_spec_override(name, pspec);
@@ -2563,7 +2563,7 @@ gjs_override_property(JSContext *cx,
     args.rval().setObject(*gjs_param_from_g_param(cx, new_pspec));
     g_param_spec_unref(new_pspec);
 
-    return JS_TRUE;
+    return true;
 }
 
 static void
@@ -2762,7 +2762,7 @@ save_properties_for_class_init(JSContext *cx,
         }
 
         JS::RootedObject prop_obj(cx, &prop_val.toObject());
-        if (!gjs_typecheck_param(cx, prop_obj, G_TYPE_NONE, JS_TRUE)) {
+        if (!gjs_typecheck_param(cx, prop_obj, G_TYPE_NONE, true)) {
             g_clear_pointer(&properties_native, g_ptr_array_unref);
             return FALSE;
         }
@@ -2775,7 +2775,7 @@ save_properties_for_class_init(JSContext *cx,
     return TRUE;
 }
 
-static JSBool
+static bool
 gjs_register_interface(JSContext *cx,
                        unsigned   argc,
                        JS::Value *vp)
@@ -2806,12 +2806,12 @@ gjs_register_interface(JSContext *cx,
                              "name", &name,
                              "interfaces", &interfaces,
                              "properties", &properties))
-        return JS_FALSE;
+        return false;
 
     if (!validate_interfaces_and_properties_args(cx, interfaces, properties,
                                                  &n_interfaces, &n_properties)) {
         g_clear_pointer(&name, g_free);
-        return JS_FALSE;
+        return false;
     }
 
     iface_types = (GType *) g_alloca(sizeof(GType) * n_interfaces);
@@ -2820,13 +2820,13 @@ gjs_register_interface(JSContext *cx,
        is caught early, before registering the GType (which we can't undo) */
     if (!get_interface_gtypes(cx, interfaces, n_interfaces, iface_types)) {
         g_clear_pointer(&name, g_free);
-        return JS_FALSE;
+        return false;
     }
 
     if (g_type_from_name(name) != G_TYPE_INVALID) {
         gjs_throw(cx, "Type name %s is already registered", name);
         g_clear_pointer(&name, g_free);
-        return JS_FALSE;
+        return false;
     }
 
     type_module = G_TYPE_MODULE(gjs_type_module_get());
@@ -2840,21 +2840,21 @@ gjs_register_interface(JSContext *cx,
     g_type_set_qdata(interface_type, gjs_is_custom_type_quark(), GINT_TO_POINTER(1));
 
     if (!save_properties_for_class_init(cx, properties, n_properties, interface_type))
-        return JS_FALSE;
+        return false;
 
     for (i = 0; i < n_interfaces; i++)
         g_type_interface_add_prerequisite(interface_type, iface_types[i]);
 
     /* create a custom JSClass */
     if ((module = gjs_lookup_private_namespace(cx)) == NULL)
-        return JS_FALSE;  /* error will have been thrown already */
+        return false;  /* error will have been thrown already */
     gjs_define_interface_class(cx, module, NULL, interface_type, &constructor);
 
     args.rval().setObject(*constructor);
-    return JS_TRUE;
+    return true;
 }
 
-static JSBool
+static bool
 gjs_register_type(JSContext *cx,
                   unsigned   argc,
                   JS::Value *vp)
@@ -2882,7 +2882,7 @@ gjs_register_type(JSContext *cx,
     };
     guint32 i, n_interfaces, n_properties;
     GType *iface_types;
-    JSBool retval = JS_FALSE;
+    bool retval = false;
 
     JS_BeginRequest(cx);
 
@@ -2897,7 +2897,7 @@ gjs_register_type(JSContext *cx,
     if (!parent)
         goto out;
 
-    if (!do_base_typecheck(cx, parent, JS_TRUE))
+    if (!do_base_typecheck(cx, parent, true))
         goto out;
 
     if (!validate_interfaces_and_properties_args(cx, interfaces, properties,
@@ -2955,7 +2955,7 @@ gjs_register_type(JSContext *cx,
 
     argv.rval().setObject(*constructor);
 
-    retval = JS_TRUE;
+    retval = true;
 
 out:
     JS_EndRequest(cx);
@@ -2963,7 +2963,7 @@ out:
     return retval;
 }
 
-static JSBool
+static bool
 gjs_signal_new(JSContext *cx,
                unsigned   argc,
                JS::Value *vp)
@@ -2976,21 +2976,21 @@ gjs_signal_new(JSContext *cx,
     gint signal_id;
     guint i, n_parameters;
     GType *params, return_type;
-    JSBool ret;
+    bool ret;
 
     if (argc != 6)
-        return JS_FALSE;
+        return false;
 
     JS_BeginRequest(cx);
 
     if (!gjs_string_to_utf8(cx, argv[1], &signal_name)) {
-        ret = JS_FALSE;
+        ret = false;
         goto out;
     }
 
     obj = &argv[0].toObject();
-    if (!gjs_typecheck_gtype(cx, obj, JS_TRUE))
-        return JS_FALSE;
+    if (!gjs_typecheck_gtype(cx, obj, true))
+        return false;
 
     /* we only support standard accumulators for now */
     switch (argv[3].toInt32()) {
@@ -3009,12 +3009,12 @@ gjs_signal_new(JSContext *cx,
 
     if (accumulator == g_signal_accumulator_true_handled && return_type != G_TYPE_BOOLEAN) {
         gjs_throw (cx, "GObject.SignalAccumulator.TRUE_HANDLED can only be used with boolean signals");
-        ret = JS_FALSE;
+        ret = false;
         goto out;
     }
 
     if (!JS_GetArrayLength(cx, &argv[5].toObject(), &n_parameters)) {
-        ret = JS_FALSE;
+        ret = false;
         goto out;
     }
     params = g_newa(GType, n_parameters);
@@ -3023,7 +3023,7 @@ gjs_signal_new(JSContext *cx,
         if (!JS_GetElement(cx, &argv[5].toObject(), i, &gtype_val) ||
             !gtype_val.isObject()) {
             gjs_throw(cx, "Invalid signal parameter number %d", i);
-            ret = JS_FALSE;
+            ret = false;
             goto out;
         }
 
@@ -3044,7 +3044,7 @@ gjs_signal_new(JSContext *cx,
                               params);
 
     argv.rval().setInt32(signal_id);
-    ret = JS_TRUE;
+    ret = true;
 
  out:
     JS_EndRequest(cx);
@@ -3063,7 +3063,7 @@ static JSFunctionSpec module_funcs[] = {
     { NULL },
 };
 
-JSBool
+bool
 gjs_define_private_gi_stuff(JSContext *context,
                             JSObject **module_out)
 {
@@ -3072,14 +3072,14 @@ gjs_define_private_gi_stuff(JSContext *context,
     module = JS_NewObject (context, NULL, NULL, NULL);
 
     if (!JS_DefineFunctions(context, module, &module_funcs[0]))
-        return JS_FALSE;
+        return false;
 
     *module_out = module;
 
-    return JS_TRUE;
+    return true;
 }
 
-JSBool
+bool
 gjs_lookup_object_constructor(JSContext *context,
                               GType      gtype,
                               JS::Value *value_p)
@@ -3096,11 +3096,11 @@ gjs_lookup_object_constructor(JSContext *context,
     constructor = gjs_lookup_object_constructor_from_info(context, object_info, gtype);
 
     if (G_UNLIKELY (constructor == NULL))
-        return JS_FALSE;
+        return false;
 
     if (object_info)
         g_base_info_unref((GIBaseInfo*)object_info);
 
     *value_p = JS::ObjectValue(*constructor);
-    return JS_TRUE;
+    return true;
 }
diff --git a/gi/object.h b/gi/object.h
index 376f8fd..fdc7156 100644
--- a/gi/object.h
+++ b/gi/object.h
@@ -35,24 +35,24 @@ void      gjs_define_object_class       (JSContext     *context,
                                          GIObjectInfo  *info,
                                          GType          gtype,
                                          JSObject     **constructor_p);
-JSBool    gjs_lookup_object_constructor (JSContext     *context,
+bool      gjs_lookup_object_constructor (JSContext     *context,
                                          GType          gtype,
                                          JS::Value     *value_p);
 JSObject* gjs_object_from_g_object      (JSContext     *context,
                                          GObject       *gobj);
 GObject*  gjs_g_object_from_object      (JSContext     *context,
                                          JSObject      *obj);
-JSBool    gjs_typecheck_object          (JSContext     *context,
+bool      gjs_typecheck_object          (JSContext     *context,
                                          JSObject      *obj,
                                          GType          expected_type,
-                                         JSBool         throw_error);
-JSBool    gjs_typecheck_is_object       (JSContext     *context,
+                                         bool           throw_error);
+bool      gjs_typecheck_is_object       (JSContext     *context,
                                          JSObject      *obj,
-                                         JSBool         throw_error);
+                                         bool           throw_error);
 
 void      gjs_object_prepare_shutdown   (JSContext     *context);
 
-JSBool    gjs_object_define_static_methods(JSContext    *context,
+bool      gjs_object_define_static_methods(JSContext    *context,
                                            JSObject     *constructor,
                                            GType         gtype,
                                            GIObjectInfo *object_info);
diff --git a/gi/param.cpp b/gi/param.cpp
index 8fbda12..c6e08f5 100644
--- a/gi/param.cpp
+++ b/gi/param.cpp
@@ -57,7 +57,7 @@ GJS_DEFINE_PRIV_FROM_JS(Param, gjs_param_class)
  * was not resolved; and non-null, referring to obj or one of its prototypes,
  * if id was resolved.
  */
-static JSBool
+static bool
 param_new_resolve(JSContext *context,
                   JS::HandleObject obj,
                   JS::HandleId id,
@@ -68,16 +68,16 @@ param_new_resolve(JSContext *context,
     GIFunctionInfo *method_info;
     Param *priv;
     char *name;
-    JSBool ret = JS_FALSE;
+    bool ret = false;
 
     if (!gjs_get_string_id(context, id, &name))
-        return JS_TRUE; /* not resolved, but no error */
+        return true; /* not resolved, but no error */
 
     priv = priv_from_js(context, obj);
 
     if (priv != NULL) {
         /* instance, not prototype */
-        ret = JS_TRUE;
+        ret = true;
         goto out;
     }
 
@@ -85,7 +85,7 @@ param_new_resolve(JSContext *context,
     method_info = g_object_info_find_method(info, name);
 
     if (method_info == NULL) {
-        ret = JS_TRUE;
+        ret = true;
         goto out;
     }
 #if GJS_VERBOSE_ENABLE_GI_USAGE
@@ -107,7 +107,7 @@ param_new_resolve(JSContext *context,
 
     g_base_info_unref( (GIBaseInfo*) method_info);
 
-    ret = JS_TRUE;
+    ret = true;
  out:
     g_free(name);
     if (info != NULL)
@@ -122,7 +122,7 @@ GJS_NATIVE_CONSTRUCTOR_DECLARE(param)
     GJS_NATIVE_CONSTRUCTOR_PRELUDE(param);
     GJS_INC_COUNTER(param);
     GJS_NATIVE_CONSTRUCTOR_FINISH(param);
-    return JS_TRUE;
+    return true;
 }
 
 static void
@@ -307,17 +307,17 @@ gjs_g_param_from_param(JSContext    *context,
     return priv->gparam;
 }
 
-JSBool
+bool
 gjs_typecheck_param(JSContext     *context,
                     JSObject      *object,
                     GType          expected_type,
-                    JSBool         throw_error)
+                    bool           throw_error)
 {
     Param *priv;
-    JSBool result;
+    bool result;
 
     if (!do_base_typecheck(context, object, throw_error))
-        return JS_FALSE;
+        return false;
 
     priv = priv_from_js(context, object);
 
@@ -328,13 +328,13 @@ gjs_typecheck_param(JSContext     *context,
                              "cannot convert to a GObject.ParamSpec instance");
         }
 
-        return JS_FALSE;
+        return false;
     }
 
     if (expected_type != G_TYPE_NONE)
         result = g_type_is_a (G_TYPE_FROM_INSTANCE (priv->gparam), expected_type);
     else
-        result = JS_TRUE;
+        result = true;
 
     if (!result && throw_error) {
         gjs_throw_custom(context, "TypeError",
diff --git a/gi/param.h b/gi/param.h
index 3de1bb4..b2a952f 100644
--- a/gi/param.h
+++ b/gi/param.h
@@ -36,10 +36,10 @@ GParamSpec* gjs_g_param_from_param     (JSContext  *context,
                                         JSObject   *obj);
 JSObject*   gjs_param_from_g_param     (JSContext  *context,
                                         GParamSpec *param);
-JSBool      gjs_typecheck_param        (JSContext  *context,
+bool        gjs_typecheck_param        (JSContext  *context,
                                         JSObject   *obj,
                                         GType       expected_type,
-                                        JSBool      throw_error);
+                                        bool        throw_error);
 
 G_END_DECLS
 
diff --git a/gi/proxyutils.cpp b/gi/proxyutils.cpp
index f40b5a5..1bf0b4f 100644
--- a/gi/proxyutils.cpp
+++ b/gi/proxyutils.cpp
@@ -31,7 +31,7 @@
  * with something that gives us both the introspection name
  * and a memory address.
  */
-JSBool
+bool
 _gjs_proxy_to_string_func(JSContext  *context,
                           JSObject   *this_obj,
                           const char *objtype,
@@ -41,7 +41,7 @@ _gjs_proxy_to_string_func(JSContext  *context,
                           JS::Value  *rval)
 {
     GString *buf;
-    JSBool ret = JS_FALSE;
+    bool ret = false;
 
     buf = g_string_new("");
     g_string_append_c(buf, '[');
@@ -69,7 +69,7 @@ _gjs_proxy_to_string_func(JSContext  *context,
     if (!gjs_string_from_utf8 (context, buf->str, -1, rval))
         goto out;
 
-    ret = JS_TRUE;
+    ret = true;
  out:
     g_string_free (buf, TRUE);
     return ret;
diff --git a/gi/proxyutils.h b/gi/proxyutils.h
index 20324c7..6161f3b 100644
--- a/gi/proxyutils.h
+++ b/gi/proxyutils.h
@@ -29,13 +29,13 @@
 
 G_BEGIN_DECLS
 
-JSBool _gjs_proxy_to_string_func(JSContext  *context,
-                                 JSObject   *this_obj,
-                                 const char *objtype,
-                                 GIBaseInfo *info,
-                                 GType       gtype,
-                                 gpointer    native_address,
-                                 JS::Value  *ret);
+bool _gjs_proxy_to_string_func (JSContext  *context,
+                                JSObject   *this_obj,
+                                const char *objtype,
+                                GIBaseInfo *info,
+                                GType       gtype,
+                                gpointer    native_address,
+                                JS::Value  *ret);
 
 G_END_DECLS
 
diff --git a/gi/repo.cpp b/gi/repo.cpp
index 20cefe2..ae59183 100644
--- a/gi/repo.cpp
+++ b/gi/repo.cpp
@@ -56,7 +56,7 @@ GJS_DEFINE_PRIV_FROM_JS(Repo, gjs_repo_class)
 
 static JSObject * lookup_override_function(JSContext *, jsid);
 
-static JSBool
+static bool
 get_version_for_ns (JSContext *context,
                     JSObject  *repo_obj,
                     jsid       ns_id,
@@ -71,7 +71,7 @@ get_version_for_ns (JSContext *context,
     if (!gjs_object_require_property(context, repo_obj, "GI repository object", versions_name, 
&versions_val) ||
         !versions_val.isObject()) {
         gjs_throw(context, "No 'versions' property in GI repository object");
-        return JS_FALSE;
+        return false;
     }
 
     versions = &versions_val.toObject();
@@ -82,10 +82,10 @@ get_version_for_ns (JSContext *context,
         gjs_string_to_utf8(context, version_val, version);
     }
 
-    return JS_TRUE;
+    return true;
 }
 
-static JSBool
+static bool
 resolve_namespace_object(JSContext  *context,
                          JSObject   *repo_obj,
                          jsid        ns_id,
@@ -97,7 +97,7 @@ resolve_namespace_object(JSContext  *context,
     JSObject *override;
     JS::Value result;
     JSObject *gi_namespace = NULL;
-    JSBool ret = JS_FALSE;
+    bool ret = false;
 
     JS_BeginRequest(context);
 
@@ -147,7 +147,7 @@ resolve_namespace_object(JSContext  *context,
     gjs_debug(GJS_DEBUG_GNAMESPACE,
               "Defined namespace '%s' %p in GIRepository %p", ns_name, gi_namespace, repo_obj);
 
-    ret = JS_TRUE;
+    ret = true;
     gjs_schedule_gc_if_needed(context);
 
  out:
@@ -170,7 +170,7 @@ resolve_namespace_object(JSContext  *context,
  * was not resolved; and non-null, referring to obj or one of its prototypes,
  * if id was resolved.
  */
-static JSBool
+static bool
 repo_new_resolve(JSContext *context,
                  JS::HandleObject obj,
                  JS::HandleId id,
@@ -179,10 +179,10 @@ repo_new_resolve(JSContext *context,
 {
     Repo *priv;
     char *name;
-    JSBool ret = JS_TRUE;
+    bool ret = true;
 
     if (!gjs_get_string_id(context, id, &name))
-        return JS_TRUE; /* not resolved, but no error */
+        return true; /* not resolved, but no error */
 
     /* let Object.prototype resolve these */
     if (strcmp(name, "valueOf") == 0 ||
@@ -197,7 +197,7 @@ repo_new_resolve(JSContext *context,
         goto out;
 
     if (!resolve_namespace_object(context, obj, id, name)) {
-        ret = JS_FALSE;
+        ret = false;
     } else {
         objp.set(obj); /* store the object we defined the prop in */
     }
@@ -340,7 +340,7 @@ repo_new(JSContext *context)
     return repo;
 }
 
-JSBool
+bool
 gjs_define_repo(JSContext  *context,
                 JSObject  **module_out,
                 const char *name)
@@ -350,10 +350,10 @@ gjs_define_repo(JSContext  *context,
     repo = repo_new(context);
     *module_out = repo;
 
-    return JS_TRUE;
+    return true;
 }
 
-static JSBool
+static bool
 gjs_define_constant(JSContext      *context,
                     JSObject       *in_object,
                     GIConstantInfo *info)
@@ -362,7 +362,7 @@ gjs_define_constant(JSContext      *context,
     GArgument garg = { 0, };
     GITypeInfo *type_info;
     const char *name;
-    JSBool ret = JS_FALSE;
+    bool ret = false;
 
     type_info = g_constant_info_get_type(info);
     g_constant_info_get_value(info, &garg);
@@ -376,7 +376,7 @@ gjs_define_constant(JSContext      *context,
                           name, value,
                           NULL, NULL,
                           GJS_MODULE_PROP_FLAGS))
-        ret = JS_TRUE;
+        ret = true;
 
  out:
     g_constant_info_free_value (info, &garg);
@@ -450,7 +450,7 @@ _gjs_log_info_usage(GIBaseInfo *info)
 }
 #endif /* GJS_VERBOSE_ENABLE_GI_USAGE */
 
-JSBool
+bool
 gjs_define_info(JSContext  *context,
                 JSObject   *in_object,
                 GIBaseInfo *info,
@@ -468,7 +468,7 @@ gjs_define_info(JSContext  *context,
             JSObject *f;
             f = gjs_define_function(context, in_object, 0, (GICallableInfo*) info);
             if (f == NULL)
-                return JS_FALSE;
+                return false;
         }
         break;
     case GI_INFO_TYPE_OBJECT:
@@ -485,13 +485,13 @@ gjs_define_info(JSContext  *context,
                     gjs_throw (context,
                                "Unsupported fundamental class creation for type %s",
                                g_type_name(gtype));
-                    return JS_FALSE;
+                    return false;
                 }
             } else {
                 gjs_throw (context,
                            "Unsupported type %s, deriving from fundamental %s",
                            g_type_name(gtype), g_type_name(g_type_fundamental(gtype)));
-                return JS_FALSE;
+                return false;
             }
         }
         break;
@@ -511,7 +511,7 @@ gjs_define_info(JSContext  *context,
         break;
     case GI_INFO_TYPE_UNION:
         if (!gjs_define_union_class(context, in_object, (GIUnionInfo*) info))
-            return JS_FALSE;
+            return false;
         break;
     case GI_INFO_TYPE_ENUM:
         if (g_enum_info_get_error_domain((GIEnumInfo*) info)) {
@@ -523,11 +523,11 @@ gjs_define_info(JSContext  *context,
 
     case GI_INFO_TYPE_FLAGS:
         if (!gjs_define_enumeration(context, in_object, (GIEnumInfo*) info))
-            return JS_FALSE;
+            return false;
         break;
     case GI_INFO_TYPE_CONSTANT:
         if (!gjs_define_constant(context, in_object, (GIConstantInfo*) info))
-            return JS_FALSE;
+            return false;
         break;
     case GI_INFO_TYPE_INTERFACE:
         gjs_define_interface_class(context, in_object, (GIInterfaceInfo *) info,
@@ -539,10 +539,10 @@ gjs_define_info(JSContext  *context,
                   gjs_info_type_name(g_base_info_get_type(info)),
                   g_base_info_get_namespace(info),
                   g_base_info_get_name(info));
-        return JS_FALSE;
+        return false;
     }
 
-    return JS_TRUE;
+    return true;
 }
 
 /* Get the "unknown namespace", which should be used for unnamespaced types */
diff --git a/gi/repo.h b/gi/repo.h
index ad4c7ed..bddab55 100644
--- a/gi/repo.h
+++ b/gi/repo.h
@@ -33,7 +33,7 @@
 
 G_BEGIN_DECLS
 
-JSBool      gjs_define_repo                     (JSContext      *context,
+bool        gjs_define_repo                     (JSContext      *context,
                                                  JSObject      **module_out,
                                                  const char     *name);
 const char* gjs_info_type_name                  (GIInfoType      type);
@@ -48,7 +48,7 @@ JSObject *  gjs_lookup_generic_constructor      (JSContext      *context,
                                                  GIBaseInfo     *info);
 JSObject *  gjs_lookup_generic_prototype        (JSContext      *context,
                                                  GIBaseInfo     *info);
-JSBool      gjs_define_info                     (JSContext      *context,
+bool        gjs_define_info                     (JSContext      *context,
                                                  JSObject       *in_object,
                                                  GIBaseInfo     *info,
                                                  gboolean       *defined);
diff --git a/gi/union.cpp b/gi/union.cpp
index 3ff76cb..1506c58 100644
--- a/gi/union.cpp
+++ b/gi/union.cpp
@@ -62,7 +62,7 @@ GJS_DEFINE_PRIV_FROM_JS(Union, gjs_union_class)
  * was not resolved; and non-null, referring to obj or one of its prototypes,
  * if id was resolved.
  */
-static JSBool
+static bool
 union_new_resolve(JSContext *context,
                   JS::HandleObject obj,
                   JS::HandleId id,
@@ -71,17 +71,17 @@ union_new_resolve(JSContext *context,
 {
     Union *priv;
     char *name;
-    JSBool ret = JS_TRUE;
+    bool ret = true;
 
     if (!gjs_get_string_id(context, id, &name))
-        return JS_TRUE; /* not resolved, but no error */
+        return true; /* not resolved, but no error */
 
     priv = priv_from_js(context, obj);
     gjs_debug_jsprop(GJS_DEBUG_GBOXED, "Resolve prop '%s' hook obj %p priv %p",
                      name, (void *)obj, priv);
 
     if (priv == NULL) {
-        ret = JS_FALSE; /* wrong class */
+        ret = false; /* wrong class */
         goto out;
     }
 
@@ -114,7 +114,7 @@ union_new_resolve(JSContext *context,
                                         g_registered_type_info_get_g_type(priv->info),
                                         method_info) == NULL) {
                     g_base_info_unref( (GIBaseInfo*) method_info);
-                    ret = JS_FALSE;
+                    ret = false;
                     goto out;
                 }
 
@@ -219,7 +219,7 @@ GJS_NATIVE_CONSTRUCTOR_DECLARE(union)
     if (proto_priv == NULL) {
         gjs_debug(GJS_DEBUG_GBOXED,
                   "Bad prototype set on union? Must match JSClass of object. JS error should have been 
reported.");
-        return JS_FALSE;
+        return false;
     }
 
     priv->info = proto_priv->info;
@@ -234,7 +234,7 @@ GJS_NATIVE_CONSTRUCTOR_DECLARE(union)
     gboxed = union_new(context, object, priv->info);
 
     if (gboxed == NULL) {
-        return JS_FALSE;
+        return false;
     }
 
     /* Because "gboxed" is owned by a JS::Value and will
@@ -249,7 +249,7 @@ GJS_NATIVE_CONSTRUCTOR_DECLARE(union)
 
     GJS_NATIVE_CONSTRUCTOR_FINISH(union);
 
-    return JS_TRUE;
+    return true;
 }
 
 static void
@@ -279,7 +279,7 @@ union_finalize(JSFreeOp *fop,
     g_slice_free(Union, priv);
 }
 
-static JSBool
+static bool
 to_string_func(JSContext *context,
                unsigned   argc,
                JS::Value *vp)
@@ -288,7 +288,7 @@ to_string_func(JSContext *context,
     JSObject *obj = rec.thisv().toObjectOrNull();
 
     Union *priv;
-    JSBool ret = JS_FALSE;
+    bool ret = false;
     JS::Value retval;
 
     if (!priv_from_js_with_typecheck(context, obj, &priv))
@@ -298,7 +298,7 @@ to_string_func(JSContext *context,
                                    priv->gtype, priv->gboxed, &retval))
         goto out;
 
-    ret = JS_TRUE;
+    ret = true;
     rec.rval().set(retval);
  out:
     return ret;
@@ -334,7 +334,7 @@ JSFunctionSpec gjs_union_proto_funcs[] = {
     { NULL }
 };
 
-JSBool
+bool
 gjs_define_union_class(JSContext    *context,
                        JSObject     *in_object,
                        GIUnionInfo  *info)
@@ -352,7 +352,7 @@ gjs_define_union_class(JSContext    *context,
     gtype = g_registered_type_info_get_g_type( (GIRegisteredTypeInfo*) info);
     if (gtype == G_TYPE_NONE) {
         gjs_throw(context, "Unions must currently be registered as boxed types");
-        return JS_FALSE;
+        return false;
     }
 
     /* See the comment in gjs_define_object_class() for an
@@ -395,7 +395,7 @@ gjs_define_union_class(JSContext    *context,
     JS_DefineProperty(context, constructor, "$gtype", value,
                       NULL, NULL, JSPROP_PERMANENT);
 
-    return JS_TRUE;
+    return true;
 }
 
 JSObject*
@@ -455,18 +455,18 @@ gjs_c_union_from_union(JSContext    *context,
     return priv->gboxed;
 }
 
-JSBool
+bool
 gjs_typecheck_union(JSContext     *context,
                     JSObject      *object,
                     GIStructInfo  *expected_info,
                     GType          expected_type,
-                    JSBool         throw_error)
+                    bool           throw_error)
 {
     Union *priv;
-    JSBool result;
+    bool result;
 
     if (!do_base_typecheck(context, object, throw_error))
-        return JS_FALSE;
+        return false;
 
     priv = priv_from_js(context, object);
 
@@ -478,7 +478,7 @@ gjs_typecheck_union(JSContext     *context,
                              g_base_info_get_name( (GIBaseInfo*) priv->info));
         }
 
-        return JS_FALSE;
+        return false;
     }
 
     if (expected_type != G_TYPE_NONE)
@@ -486,7 +486,7 @@ gjs_typecheck_union(JSContext     *context,
     else if (expected_info != NULL)
         result = g_base_info_equal((GIBaseInfo*) priv->info, (GIBaseInfo*) expected_info);
     else
-        result = JS_TRUE;
+        result = true;
 
     if (!result && throw_error) {
         if (expected_info != NULL) {
diff --git a/gi/union.h b/gi/union.h
index bf97ef4..5c3f1be 100644
--- a/gi/union.h
+++ b/gi/union.h
@@ -30,7 +30,7 @@
 
 G_BEGIN_DECLS
 
-JSBool    gjs_define_union_class       (JSContext    *context,
+bool      gjs_define_union_class       (JSContext    *context,
                                         JSObject     *in_object,
                                         GIUnionInfo  *info);
 void*     gjs_c_union_from_union       (JSContext    *context,
@@ -38,11 +38,11 @@ void*     gjs_c_union_from_union       (JSContext    *context,
 JSObject* gjs_union_from_c_union       (JSContext    *context,
                                         GIUnionInfo  *info,
                                         void         *gboxed);
-JSBool    gjs_typecheck_union          (JSContext             *context,
+bool      gjs_typecheck_union          (JSContext             *context,
                                         JSObject              *obj,
                                         GIStructInfo          *expected_info,
                                         GType                  expected_type,
-                                        JSBool                 throw_error);
+                                        bool                   throw_error);
 
 G_END_DECLS
 
diff --git a/gi/value.cpp b/gi/value.cpp
index be2c2c2..b2ef11d 100644
--- a/gi/value.cpp
+++ b/gi/value.cpp
@@ -41,12 +41,12 @@
 
 #include <girepository.h>
 
-static JSBool gjs_value_from_g_value_internal(JSContext    *context,
-                                              JS::Value    *value_p,
-                                              const GValue *gvalue,
-                                              gboolean      no_copy,
-                                              GSignalQuery *signal_query,
-                                              gint          arg_n);
+static bool gjs_value_from_g_value_internal(JSContext    *context,
+                                            JS::Value    *value_p,
+                                            const GValue *gvalue,
+                                            gboolean      no_copy,
+                                            GSignalQuery *signal_query,
+                                            gint          arg_n);
 
 /*
  * Gets signal introspection info about closure, or NULL if not found. Currently
@@ -83,7 +83,7 @@ get_signal_info_if_available(GSignalQuery *signal_query)
  * Fill in value_p with a JS array, converted from a C array stored as a pointer
  * in array_value, with its length stored in array_length_value.
  */
-static JSBool
+static bool
 gjs_value_from_array_and_length_values(JSContext    *context,
                                        JS::Value    *value_p,
                                        GITypeInfo   *array_type_info,
@@ -102,7 +102,7 @@ gjs_value_from_array_and_length_values(JSContext    *context,
     if (!gjs_value_from_g_value_internal(context, &array_length,
                                          array_length_value, no_copy,
                                          signal_query, array_length_arg_n))
-        return JS_FALSE;
+        return false;
 
     array_arg.v_pointer = g_value_get_pointer(array_value);
 
@@ -243,7 +243,7 @@ closure_marshal(GClosure        *closure,
         const GValue *gval = &param_values[i];
         gboolean no_copy;
         int array_len_index;
-        JSBool res;
+        bool res;
 
         if (skip[i])
             continue;
@@ -361,7 +361,7 @@ gjs_value_guess_g_type(JSContext *context,
     return G_TYPE_INVALID;
 }
 
-static JSBool
+static bool
 gjs_value_to_g_value_internal(JSContext    *context,
                               JS::Value     value,
                               GValue       *gvalue,
@@ -376,7 +376,7 @@ gjs_value_to_g_value_internal(JSContext    *context,
 
         if (gtype == G_TYPE_INVALID) {
             gjs_throw(context, "Could not guess unspecified GValue type");
-            return JS_FALSE;
+            return false;
         }
 
         gjs_debug_marshal(GJS_DEBUG_GCLOSURE,
@@ -401,14 +401,14 @@ gjs_value_to_g_value_internal(JSContext    *context,
             gchar *utf8_string;
 
             if (!gjs_string_to_utf8(context, value, &utf8_string))
-                return JS_FALSE;
+                return false;
 
             g_value_take_string(gvalue, utf8_string);
         } else {
             gjs_throw(context,
                       "Wrong type %s; string expected",
                       gjs_get_type_name(value));
-            return JS_FALSE;
+            return false;
         }
     } else if (gtype == G_TYPE_CHAR) {
         gint32 i;
@@ -418,7 +418,7 @@ gjs_value_to_g_value_internal(JSContext    *context,
             gjs_throw(context,
                       "Wrong type %s; char expected",
                       gjs_get_type_name(value));
-            return JS_FALSE;
+            return false;
         }
     } else if (gtype == G_TYPE_UCHAR) {
         guint16 i;
@@ -428,7 +428,7 @@ gjs_value_to_g_value_internal(JSContext    *context,
             gjs_throw(context,
                       "Wrong type %s; unsigned char expected",
                       gjs_get_type_name(value));
-            return JS_FALSE;
+            return false;
         }
     } else if (gtype == G_TYPE_INT) {
         gint32 i;
@@ -438,7 +438,7 @@ gjs_value_to_g_value_internal(JSContext    *context,
             gjs_throw(context,
                       "Wrong type %s; integer expected",
                       gjs_get_type_name(value));
-            return JS_FALSE;
+            return false;
         }
     } else if (gtype == G_TYPE_DOUBLE) {
         gdouble d;
@@ -448,7 +448,7 @@ gjs_value_to_g_value_internal(JSContext    *context,
             gjs_throw(context,
                       "Wrong type %s; double expected",
                       gjs_get_type_name(value));
-            return JS_FALSE;
+            return false;
         }
     } else if (gtype == G_TYPE_FLOAT) {
         gdouble d;
@@ -458,7 +458,7 @@ gjs_value_to_g_value_internal(JSContext    *context,
             gjs_throw(context,
                       "Wrong type %s; float expected",
                       gjs_get_type_name(value));
-            return JS_FALSE;
+            return false;
         }
     } else if (gtype == G_TYPE_UINT) {
         guint32 i;
@@ -468,7 +468,7 @@ gjs_value_to_g_value_internal(JSContext    *context,
             gjs_throw(context,
                       "Wrong type %s; unsigned integer expected",
                       gjs_get_type_name(value));
-            return JS_FALSE;
+            return false;
         }
     } else if (gtype == G_TYPE_BOOLEAN) {
         JSBool b;
@@ -483,7 +483,7 @@ gjs_value_to_g_value_internal(JSContext    *context,
             gjs_throw(context,
                       "Wrong type %s; boolean expected",
                       gjs_get_type_name(value));
-            return JS_FALSE;
+            return false;
         }
     } else if (g_type_is_a(gtype, G_TYPE_OBJECT) || g_type_is_a(gtype, G_TYPE_INTERFACE)) {
         GObject *gobj;
@@ -495,9 +495,8 @@ gjs_value_to_g_value_internal(JSContext    *context,
             JSObject *obj;
             obj = &value.toObject();
 
-            if (!gjs_typecheck_object(context, obj,
-                                      gtype, JS_TRUE))
-                return JS_FALSE;
+            if (!gjs_typecheck_object(context, obj, gtype, true))
+                return false;
 
             gobj = gjs_g_object_from_object(context, obj);
         } else {
@@ -505,7 +504,7 @@ gjs_value_to_g_value_internal(JSContext    *context,
                       "Wrong type %s; object %s expected",
                       gjs_get_type_name(value),
                       g_type_name(gtype));
-            return JS_FALSE;
+            return false;
         }
 
         g_value_set_object(gvalue, gobj);
@@ -529,7 +528,7 @@ gjs_value_to_g_value_internal(JSContext    *context,
                 gjs_throw(context,
                           "Wrong type %s; strv expected",
                           gjs_get_type_name(value));
-                return JS_FALSE;
+                return false;
             } else {
                 void *result;
                 char **strv;
@@ -537,7 +536,7 @@ gjs_value_to_g_value_internal(JSContext    *context,
                 if (!gjs_array_to_strv (context,
                                         value,
                                         length, &result))
-                    return JS_FALSE;
+                    return false;
                 /* cast to strv in a separate step to avoid type-punning */
                 strv = (char**) result;
                 g_value_take_boxed (gvalue, strv);
@@ -546,7 +545,7 @@ gjs_value_to_g_value_internal(JSContext    *context,
             gjs_throw(context,
                       "Wrong type %s; strv expected",
                       gjs_get_type_name(value));
-            return JS_FALSE;
+            return false;
         }
     } else if (g_type_is_a(gtype, G_TYPE_BOXED)) {
         void *gboxed;
@@ -560,8 +559,8 @@ gjs_value_to_g_value_internal(JSContext    *context,
 
             if (g_type_is_a(gtype, G_TYPE_ERROR)) {
                 /* special case GError */
-                if (!gjs_typecheck_gerror(context, obj, JS_TRUE))
-                    return JS_FALSE;
+                if (!gjs_typecheck_gerror(context, obj, true))
+                    return false;
 
                 gboxed = gjs_gerror_from_error(context, obj);
             } else {
@@ -596,13 +595,11 @@ gjs_value_to_g_value_internal(JSContext    *context,
                    loading the typelib.
                 */
                 if (!gboxed) {
-                    if (gjs_typecheck_union(context, obj,
-                                            NULL, gtype, JS_FALSE)) {
+                    if (gjs_typecheck_union(context, obj, NULL, gtype, false)) {
                         gboxed = gjs_c_union_from_union(context, obj);
                     } else {
-                        if (!gjs_typecheck_boxed(context, obj,
-                                                 NULL, gtype, JS_TRUE))
-                            return JS_FALSE;
+                        if (!gjs_typecheck_boxed(context, obj, NULL, gtype, true))
+                            return false;
 
                         gboxed = gjs_c_struct_from_boxed(context, obj);
                     }
@@ -613,7 +610,7 @@ gjs_value_to_g_value_internal(JSContext    *context,
                       "Wrong type %s; boxed type %s expected",
                       gjs_get_type_name(value),
                       g_type_name(gtype));
-            return JS_FALSE;
+            return false;
         }
 
         if (no_copy)
@@ -628,9 +625,8 @@ gjs_value_to_g_value_internal(JSContext    *context,
         } else if (value.isObject()) {
             JSObject *obj = &value.toObject();
 
-            if (!gjs_typecheck_boxed(context, obj,
-                                     NULL, G_TYPE_VARIANT, JS_TRUE))
-                return JS_FALSE;
+            if (!gjs_typecheck_boxed(context, obj, NULL, G_TYPE_VARIANT, true))
+                return false;
 
             variant = (GVariant*) gjs_c_struct_from_boxed(context, obj);
         } else {
@@ -638,7 +634,7 @@ gjs_value_to_g_value_internal(JSContext    *context,
                       "Wrong type %s; boxed type %s expected",
                       gjs_get_type_name(value),
                       g_type_name(gtype));
-            return JS_FALSE;
+            return false;
         }
 
         g_value_set_variant (gvalue, variant);
@@ -657,7 +653,7 @@ gjs_value_to_g_value_internal(JSContext    *context,
                 gjs_throw(context,
                           "%d is not a valid value for enumeration %s",
                           value.toInt32(), g_type_name(gtype));
-                return JS_FALSE;
+                return false;
             }
 
             g_value_set_enum(gvalue, v->value);
@@ -666,14 +662,14 @@ gjs_value_to_g_value_internal(JSContext    *context,
                          "Wrong type %s; enum %s expected",
                          gjs_get_type_name(value),
                          g_type_name(gtype));
-            return JS_FALSE;
+            return false;
         }
     } else if (g_type_is_a(gtype, G_TYPE_FLAGS)) {
         gint64 value_int64;
 
         if (gjs_value_to_int64 (context, value, &value_int64)) {
             if (!_gjs_flags_value_is_valid(context, gtype, value_int64))
-                return JS_FALSE;
+                return false;
 
             /* See arg.c:_gjs_enum_to_int() */
             g_value_set_flags(gvalue, (int)value_int64);
@@ -682,7 +678,7 @@ gjs_value_to_g_value_internal(JSContext    *context,
                       "Wrong type %s; flags %s expected",
                       gjs_get_type_name(value),
                       g_type_name(gtype));
-            return JS_FALSE;
+            return false;
         }
     } else if (g_type_is_a(gtype, G_TYPE_PARAM)) {
         void *gparam;
@@ -694,8 +690,8 @@ gjs_value_to_g_value_internal(JSContext    *context,
             JSObject *obj;
             obj = &value.toObject();
 
-            if (!gjs_typecheck_param(context, obj, gtype, JS_TRUE))
-                return JS_FALSE;
+            if (!gjs_typecheck_param(context, obj, gtype, true))
+                return false;
 
             gparam = gjs_g_param_from_param(context, obj);
         } else {
@@ -703,7 +699,7 @@ gjs_value_to_g_value_internal(JSContext    *context,
                       "Wrong type %s; param type %s expected",
                       gjs_get_type_name(value),
                       g_type_name(gtype));
-            return JS_FALSE;
+            return false;
         }
 
         g_value_set_param(gvalue, (GParamSpec*) gparam);
@@ -713,7 +709,7 @@ gjs_value_to_g_value_internal(JSContext    *context,
         if (!value.isObject()) {
             gjs_throw(context, "Wrong type %s; expect a GType object",
                       gjs_get_type_name(value));
-            return JS_FALSE;
+            return false;
         }
 
         type = gjs_gtype_get_actual_gtype(context, &value.toObject());
@@ -724,7 +720,7 @@ gjs_value_to_g_value_internal(JSContext    *context,
         } else {
             gjs_throw(context,
                       "Cannot convert non-null JS value to G_POINTER");
-            return JS_FALSE;
+            return false;
         }
     } else if (value.isNumber() &&
                g_value_type_transformable(G_TYPE_INT, gtype)) {
@@ -742,7 +738,7 @@ gjs_value_to_g_value_internal(JSContext    *context,
             gjs_throw(context,
                       "Wrong type %s; integer expected",
                       gjs_get_type_name(value));
-            return JS_FALSE;
+            return false;
         }
     } else {
         gjs_debug(GJS_DEBUG_GCLOSURE, "JS::Value is number %d gtype fundamental %d transformable to int %d 
from int %d",
@@ -754,13 +750,13 @@ gjs_value_to_g_value_internal(JSContext    *context,
         gjs_throw(context,
                   "Don't know how to convert JavaScript object to GType %s",
                   g_type_name(gtype));
-        return JS_FALSE;
+        return false;
     }
 
-    return JS_TRUE;
+    return true;
 }
 
-JSBool
+bool
 gjs_value_to_g_value(JSContext    *context,
                      JS::Value     value,
                      GValue       *gvalue)
@@ -768,7 +764,7 @@ gjs_value_to_g_value(JSContext    *context,
     return gjs_value_to_g_value_internal(context, value, gvalue, FALSE);
 }
 
-JSBool
+bool
 gjs_value_to_g_value_no_copy(JSContext    *context,
                              JS::Value     value,
                              GValue       *gvalue)
@@ -800,7 +796,7 @@ convert_int_to_enum (GType  gtype,
     return JS::NumberValue(v_double);
 }
 
-static JSBool
+static bool
 gjs_value_from_g_value_internal(JSContext    *context,
                                 JS::Value    *value_p,
                                 const GValue *gvalue,
@@ -825,7 +821,7 @@ gjs_value_from_g_value_internal(JSContext    *context,
             *value_p = JS::NullValue();
         } else {
             if (!gjs_string_from_utf8(context, v, -1, value_p))
-                return JS_FALSE;
+                return false;
         }
     } else if (gtype == G_TYPE_CHAR) {
         char v;
@@ -868,7 +864,7 @@ gjs_value_from_g_value_internal(JSContext    *context,
                                   value_p,
                                   (const char**) g_value_get_boxed (gvalue))) {
             gjs_throw(context, "Failed to convert strv to array");
-            return JS_FALSE;
+            return false;
         }
     } else if (g_type_is_a(gtype, G_TYPE_HASH_TABLE) ||
                g_type_is_a(gtype, G_TYPE_ARRAY) ||
@@ -876,7 +872,7 @@ gjs_value_from_g_value_internal(JSContext    *context,
                g_type_is_a(gtype, G_TYPE_PTR_ARRAY)) {
         gjs_throw(context,
                   "Unable to introspect element-type of container in GValue");
-        return JS_FALSE;
+        return false;
     } else if (g_type_is_a(gtype, G_TYPE_BOXED) ||
                g_type_is_a(gtype, G_TYPE_VARIANT)) {
         GjsBoxedCreationFlags boxed_flags;
@@ -906,12 +902,12 @@ gjs_value_from_g_value_internal(JSContext    *context,
             gjs_throw(context,
                       "No introspection information found for %s",
                       g_type_name(gtype));
-            return JS_FALSE;
+            return false;
         }
 
         if (g_base_info_get_type(info) == GI_INFO_TYPE_STRUCT &&
             g_struct_info_is_foreign((GIStructInfo*)info)) {
-            JSBool ret;
+            bool ret;
             GIArgument arg;
             arg.v_pointer = gboxed;
             ret = gjs_struct_foreign_convert_from_g_argument(context, value_p, info, &arg);
@@ -935,7 +931,7 @@ gjs_value_from_g_value_internal(JSContext    *context,
                       g_base_info_get_type(info),
                       g_type_name(gtype));
             g_base_info_unref(info);
-            return JS_FALSE;
+            return false;
         }
 
         *value_p = JS::ObjectOrNullValue(obj);
@@ -951,7 +947,7 @@ gjs_value_from_g_value_internal(JSContext    *context,
         obj = gjs_param_from_g_param(context, gparam);
         *value_p = JS::ObjectOrNullValue(obj);
     } else if (signal_query && g_type_is_a(gtype, G_TYPE_POINTER)) {
-        JSBool res;
+        bool res;
         GArgument arg;
         GIArgInfo *arg_info;
         GIBaseInfo *obj;
@@ -962,7 +958,7 @@ gjs_value_from_g_value_internal(JSContext    *context,
         if (!obj) {
             gjs_throw(context, "Signal argument with GType %s isn't introspectable",
                       g_type_name(signal_query->itype));
-            return JS_FALSE;
+            return false;
         }
 
         signal_info = g_object_info_find_signal((GIObjectInfo*)obj, signal_query->signal_name);
@@ -970,7 +966,7 @@ gjs_value_from_g_value_internal(JSContext    *context,
         if (!signal_info) {
             gjs_throw(context, "Unknown signal.");
             g_base_info_unref((GIBaseInfo*)obj);
-            return JS_FALSE;
+            return false;
         }
         arg_info = g_callable_info_get_arg(signal_info, arg_n - 1);
         g_arg_info_load_type(arg_info, &type_info);
@@ -997,7 +993,7 @@ gjs_value_from_g_value_internal(JSContext    *context,
         } else {
             gjs_throw(context,
                       "Can't convert non-null pointer to JS value");
-            return JS_FALSE;
+            return false;
         }
     } else if (g_value_type_transformable(gtype, G_TYPE_DOUBLE)) {
         GValue double_value = { 0, };
@@ -1019,20 +1015,20 @@ gjs_value_from_g_value_internal(JSContext    *context,
         JSObject *obj;
         obj = gjs_fundamental_from_g_value(context, (const GValue*)gvalue, gtype);
         if (obj == NULL)
-            return JS_FALSE;
+            return false;
         else
             *value_p = JS::ObjectValue(*obj);
     } else {
         gjs_throw(context,
                   "Don't know how to convert GType %s to JavaScript object",
                   g_type_name(gtype));
-        return JS_FALSE;
+        return false;
     }
 
-    return JS_TRUE;
+    return true;
 }
 
-JSBool
+bool
 gjs_value_from_g_value(JSContext    *context,
                        JS::Value    *value_p,
                        const GValue *gvalue)
diff --git a/gi/value.h b/gi/value.h
index 7490573..ed13f65 100644
--- a/gi/value.h
+++ b/gi/value.h
@@ -29,13 +29,13 @@
 
 G_BEGIN_DECLS
 
-JSBool     gjs_value_to_g_value         (JSContext    *context,
+bool       gjs_value_to_g_value         (JSContext    *context,
                                          JS::Value     value,
                                          GValue       *gvalue);
-JSBool     gjs_value_to_g_value_no_copy (JSContext    *context,
+bool       gjs_value_to_g_value_no_copy (JSContext    *context,
                                          JS::Value     value,
                                          GValue       *gvalue);
-JSBool     gjs_value_from_g_value       (JSContext    *context,
+bool       gjs_value_from_g_value       (JSContext    *context,
                                          JS::Value    *value_p,
                                          const GValue *gvalue);
 GClosure*  gjs_closure_new_marshaled    (JSContext    *context,
diff --git a/gjs/byteArray.cpp b/gjs/byteArray.cpp
index a06b11d..09ee450 100644
--- a/gjs/byteArray.cpp
+++ b/gjs/byteArray.cpp
@@ -39,14 +39,14 @@ typedef struct {
 extern struct JSClass gjs_byte_array_class;
 GJS_DEFINE_PRIV_FROM_JS(ByteArrayInstance, gjs_byte_array_class)
 
-static JSBool byte_array_get_prop      (JSContext    *context,
+static bool   byte_array_get_prop      (JSContext    *context,
                                         JS::HandleObject obj,
                                         JS::HandleId id,
                                         JS::MutableHandleValue value_p);
-static JSBool byte_array_set_prop      (JSContext    *context,
+static bool   byte_array_set_prop      (JSContext    *context,
                                         JS::HandleObject obj,
                                         JS::HandleId id,
-                                        JSBool        strict,
+                                        bool                   strict,
                                         JS::MutableHandleValue value_p);
 GJS_NATIVE_CONSTRUCTOR_DECLARE(byte_array);
 static void   byte_array_finalize      (JSFreeOp     *fop,
@@ -70,10 +70,10 @@ struct JSClass gjs_byte_array_class = {
     NULL, NULL, NULL
 };
 
-JSBool
+bool
 gjs_typecheck_bytearray(JSContext     *context,
                         JSObject      *object,
-                        JSBool         throw_error)
+                        bool           throw_error)
 {
     return do_base_typecheck(context, object, throw_error);
 }
@@ -109,7 +109,7 @@ byte_array_ensure_gbytes (ByteArrayInstance  *priv)
     }
 }
 
-static JSBool
+static bool
 gjs_value_to_gsize(JSContext         *context,
                    JS::Value          value,
                    gsize             *v_p)
@@ -126,12 +126,12 @@ gjs_value_to_gsize(JSContext         *context,
         if (i < 0) {
             gjs_throw(context, "Negative length or index %d is not allowed for ByteArray",
                       i);
-            return JS_FALSE;
+            return false;
         }
         *v_p = i;
-        return JS_TRUE;
+        return true;
     } else {
-        JSBool ret;
+        bool ret;
         /* This is pretty liberal (it converts about anything to
          * a number) but it's what we use elsewhere in gjs too.
          */
@@ -143,7 +143,7 @@ gjs_value_to_gsize(JSContext         *context,
     }
 }
 
-static JSBool
+static bool
 gjs_value_to_byte(JSContext         *context,
                   JS::Value          value,
                   guint8            *v_p)
@@ -151,20 +151,20 @@ gjs_value_to_byte(JSContext         *context,
     gsize v;
 
     if (!gjs_value_to_gsize(context, value, &v))
-        return JS_FALSE;
+        return false;
 
     if (v >= 256) {
         gjs_throw(context,
                   "Value %" G_GSIZE_FORMAT " is not a valid byte; must be in range [0,255]",
                   v);
-        return JS_FALSE;
+        return false;
     }
 
     *v_p = v;
-    return JS_TRUE;
+    return true;
 }
 
-static JSBool
+static bool
 byte_array_get_index(JSContext         *context,
                      JS::HandleObject obj,
                      ByteArrayInstance *priv,
@@ -181,18 +181,18 @@ byte_array_get_index(JSContext         *context,
                   "Index %" G_GSIZE_FORMAT " is out of range for ByteArray length %lu",
                   idx,
                   (unsigned long)len);
-        return JS_FALSE;
+        return false;
     }
 
     value_p.setInt32(data[idx]);
 
-    return JS_TRUE;
+    return true;
 }
 
 /* a hook on getting a property; set value_p to override property's value.
- * Return value is JS_FALSE on OOM/exception.
+ * Return value is false on OOM/exception.
  */
-static JSBool
+static bool
 byte_array_get_prop(JSContext *context,
                     JS::HandleObject obj,
                     JS::HandleId id,
@@ -204,16 +204,16 @@ byte_array_get_prop(JSContext *context,
     priv = priv_from_js(context, obj);
 
     if (priv == NULL)
-        return JS_TRUE; /* prototype, not an instance. */
+        return true; /* prototype, not an instance. */
 
     if (!JS_IdToValue(context, id, &id_value))
-        return JS_FALSE;
+        return false;
 
     /* First handle array indexing */
     if (id_value.isNumber()) {
         gsize idx;
         if (!gjs_value_to_gsize(context, id_value, &idx))
-            return JS_FALSE;
+            return false;
         return byte_array_get_index(context, obj, priv, idx, value_p);
     }
 
@@ -221,10 +221,10 @@ byte_array_get_prop(JSContext *context,
      * allow string versions of ints for the index, we don't bother.
      */
 
-    return JS_TRUE;
+    return true;
 }
 
-static JSBool
+static bool
 byte_array_length_getter(JSContext *context,
                          JS::HandleObject obj,
                          JS::HandleId id,
@@ -236,7 +236,7 @@ byte_array_length_getter(JSContext *context,
     priv = priv_from_js(context, obj);
 
     if (priv == NULL)
-        return JS_TRUE; /* prototype, not an instance. */
+        return true; /* prototype, not an instance. */
 
     if (priv->array != NULL)
         len = priv->array->len;
@@ -246,11 +246,11 @@ byte_array_length_getter(JSContext *context,
     return true;
 }
 
-static JSBool
+static bool
 byte_array_length_setter(JSContext *context,
                          JS::HandleObject obj,
                          JS::HandleId id,
-                         JSBool strict,
+                         bool strict,
                          JS::MutableHandleValue value_p)
 {
     ByteArrayInstance *priv;
@@ -259,20 +259,20 @@ byte_array_length_setter(JSContext *context,
     priv = priv_from_js(context, obj);
 
     if (priv == NULL)
-        return JS_TRUE; /* prototype, not instance */
+        return true; /* prototype, not instance */
 
     byte_array_ensure_array(priv);
 
     if (!gjs_value_to_gsize(context, value_p, &len)) {
         gjs_throw(context,
                   "Can't set ByteArray length to non-integer");
-        return JS_FALSE;
+        return false;
     }
     g_byte_array_set_size(priv->array, len);
-    return JS_TRUE;
+    return true;
 }
 
-static JSBool
+static bool
 byte_array_set_index(JSContext         *context,
                      JS::HandleObject obj,
                      ByteArrayInstance *priv,
@@ -282,7 +282,7 @@ byte_array_set_index(JSContext         *context,
     guint8 v;
 
     if (!gjs_value_to_byte(context, value_p, &v)) {
-        return JS_FALSE;
+        return false;
     }
 
     byte_array_ensure_array(priv);
@@ -298,17 +298,17 @@ byte_array_set_index(JSContext         *context,
     /* Stop JS from storing a copy of the value */
     value_p.setUndefined();
 
-    return JS_TRUE;
+    return true;
 }
 
 /* a hook on setting a property; set value_p to override property value to
- * be set. Return value is JS_FALSE on OOM/exception.
+ * be set. Return value is false on OOM/exception.
  */
-static JSBool
+static bool
 byte_array_set_prop(JSContext *context,
                     JS::HandleObject obj,
                     JS::HandleId id,
-                    JSBool strict,
+                    bool strict,
                     JS::MutableHandleValue value_p)
 {
     ByteArrayInstance *priv;
@@ -317,23 +317,23 @@ byte_array_set_prop(JSContext *context,
     priv = priv_from_js(context, obj);
 
     if (priv == NULL)
-        return JS_TRUE; /* prototype, not an instance. */
+        return true; /* prototype, not an instance. */
 
     if (!JS_IdToValue(context, id, &id_value))
-        return JS_FALSE;
+        return false;
 
     /* First handle array indexing */
     if (id_value.isNumber()) {
         gsize idx;
         if (!gjs_value_to_gsize(context, id_value, &idx))
-            return JS_FALSE;
+            return false;
 
         return byte_array_set_index(context, obj, priv, idx, value_p);
     }
 
     /* We don't special-case anything else for now */
 
-    return JS_TRUE;
+    return true;
 }
 
 static GByteArray *
@@ -372,7 +372,7 @@ GJS_NATIVE_CONSTRUCTOR_DECLARE(byte_array)
         if (!gjs_value_to_gsize(context, argv[0], &preallocated_length)) {
             gjs_throw(context,
                       "Argument to ByteArray constructor should be a positive number for array length");
-            return JS_FALSE;
+            return false;
         }
     }
 
@@ -383,7 +383,7 @@ GJS_NATIVE_CONSTRUCTOR_DECLARE(byte_array)
 
     GJS_NATIVE_CONSTRUCTOR_FINISH(byte_array);
 
-    return JS_TRUE;
+    return true;
 }
 
 static void
@@ -408,7 +408,7 @@ byte_array_finalize(JSFreeOp *fop,
 }
 
 /* implement toString() with an optional encoding arg */
-static JSBool
+static bool
 to_string_func(JSContext *context,
                unsigned   argc,
                JS::Value *vp)
@@ -423,13 +423,13 @@ to_string_func(JSContext *context,
     priv = priv_from_js(context, object);
 
     if (priv == NULL)
-        return JS_TRUE; /* prototype, not instance */
+        return true; /* prototype, not instance */
 
     byte_array_ensure_array(priv);
 
     if (argc >= 1 && argv[0].isString()) {
         if (!gjs_string_to_utf8(context, argv[0], &encoding))
-            return JS_FALSE;
+            return false;
 
         /* maybe we should be smarter about utf8 synonyms here.
          * doesn't matter much though. encoding_is_utf8 is
@@ -457,7 +457,7 @@ to_string_func(JSContext *context,
          * libmozjs hardwired utf8-to-utf16
          */
         JS::Value retval;
-        JSBool ok;
+        bool ok;
 
         ok = gjs_string_from_utf8(context,
                                   data,
@@ -467,7 +467,7 @@ to_string_func(JSContext *context,
             argv.rval().set(retval);
         return ok;
     } else {
-        JSBool ok = JS_FALSE;
+        bool ok = false;
         gsize bytes_written;
         GError *error;
         JSString *s;
@@ -485,7 +485,7 @@ to_string_func(JSContext *context,
         if (u16_str == NULL) {
             /* frees the GError */
             gjs_throw_g_error(context, error);
-            return JS_FALSE;
+            return false;
         }
 
         /* bytes_written should be bytes in a UTF-16 string so
@@ -497,7 +497,7 @@ to_string_func(JSContext *context,
                                 (jschar*) u16_str,
                                 bytes_written / 2);
         if (s != NULL) {
-            ok = JS_TRUE;
+            ok = true;
             argv.rval().setString(s);
         }
 
@@ -506,7 +506,7 @@ to_string_func(JSContext *context,
     }
 }
 
-static JSBool
+static bool
 to_gbytes_func(JSContext *context,
                unsigned   argc,
                JS::Value *vp)
@@ -519,8 +519,8 @@ to_gbytes_func(JSContext *context,
 
     priv = priv_from_js(context, object);
     if (priv == NULL)
-        return JS_TRUE; /* prototype, not instance */
-    
+        return true; /* prototype, not instance */
+
     byte_array_ensure_gbytes(priv);
 
     gbytes_info = g_irepository_find_by_gtype(NULL, G_TYPE_BYTES);
@@ -528,7 +528,7 @@ to_gbytes_func(JSContext *context,
                                             priv->bytes, GJS_BOXED_CREATION_NONE);
 
     rec.rval().setObjectOrNull(ret_bytes_obj);
-    return JS_TRUE;
+    return true;
 }
 
 /* Ensure that the module and class objects exists, and that in turn
@@ -579,11 +579,11 @@ from_string_func(JSContext *context,
     char *encoding;
     gboolean encoding_is_utf8;
     JSObject *obj;
-    JSBool retval = JS_FALSE;
+    bool retval = false;
 
     obj = byte_array_new(context);
     if (obj == NULL)
-        return JS_FALSE;
+        return false;
 
     JS_AddObjectRoot(context, &obj);
 
@@ -666,7 +666,7 @@ from_string_func(JSContext *context,
 
     argv.rval().setObject(*obj);
 
-    retval = JS_TRUE;
+    retval = true;
  out:
     JS_RemoveObjectRoot(context, &obj);
     return retval;
@@ -683,11 +683,11 @@ from_array_func(JSContext *context,
     guint32 len;
     guint32 i;
     JSObject *obj;
-    JSBool ret = JS_FALSE;
+    bool ret = false;
 
     obj = byte_array_new(context);
     if (obj == NULL)
-        return JS_FALSE;
+        return false;
 
     JS_AddObjectRoot(context, &obj);
 
@@ -733,7 +733,7 @@ from_array_func(JSContext *context,
         g_array_index(priv->array, guint8, i) = b;
     }
 
-    ret = JS_TRUE;
+    ret = true;
     argv.rval().setObject(*obj);
  out:
     JS_RemoveObjectRoot(context, &obj);
@@ -750,26 +750,26 @@ from_gbytes_func(JSContext *context,
     GBytes *gbytes;
     ByteArrayInstance *priv;
     JSObject *obj;
-    JSBool ret = JS_FALSE;
+    bool ret = false;
 
     if (!gjs_parse_call_args(context, "overrides_gbytes_to_array", "o", argv,
                         "bytes", &bytes_obj))
-        return JS_FALSE;
+        return false;
 
     if (!gjs_typecheck_boxed(context, bytes_obj, NULL, G_TYPE_BYTES, TRUE))
-        return JS_FALSE;
+        return false;
 
     gbytes = (GBytes*) gjs_c_struct_from_boxed(context, bytes_obj);
 
     obj = byte_array_new(context);
     if (obj == NULL)
-        return JS_FALSE;
+        return false;
     priv = priv_from_js(context, obj);
     g_assert (priv != NULL);
 
     priv->bytes = g_bytes_ref(gbytes);
 
-    ret = JS_TRUE;
+    ret = true;
     argv.rval().setObject(*obj);
     return ret;
 }
@@ -894,7 +894,7 @@ static JSFunctionSpec gjs_byte_array_module_funcs[] = {
     { NULL }
 };
 
-JSBool
+bool
 gjs_define_byte_array_stuff(JSContext  *context,
                             JSObject  **module_out)
 {
@@ -914,12 +914,12 @@ gjs_define_byte_array_stuff(JSContext  *context,
                              NULL);
 
     if (!JS_DefineFunctions(context, module, &gjs_byte_array_module_funcs[0]))
-        return JS_FALSE;
+        return false;
 
     g_assert(gjs_get_global_slot(context, GJS_GLOBAL_SLOT_BYTE_ARRAY_PROTOTYPE).isUndefined());
     gjs_set_global_slot(context, GJS_GLOBAL_SLOT_BYTE_ARRAY_PROTOTYPE,
                         JS::ObjectOrNullValue(prototype));
 
     *module_out = module;
-    return JS_TRUE;
+    return true;
 }
diff --git a/gjs/byteArray.h b/gjs/byteArray.h
index bc186ed..a276811 100644
--- a/gjs/byteArray.h
+++ b/gjs/byteArray.h
@@ -33,11 +33,11 @@
 
 G_BEGIN_DECLS
 
-JSBool    gjs_typecheck_bytearray        (JSContext     *context,
+bool          gjs_typecheck_bytearray    (JSContext     *context,
                                           JSObject      *obj,
-                                          JSBool         throw_error);
+                                          bool           throw_error);
 
-JSBool        gjs_define_byte_array_stuff    (JSContext  *context,
+bool          gjs_define_byte_array_stuff    (JSContext  *context,
                                               JSObject  **module_out);
 
 JSObject *    gjs_byte_array_from_byte_array (JSContext  *context,
diff --git a/gjs/compat.h b/gjs/compat.h
index 89c2415..55d3008 100644
--- a/gjs/compat.h
+++ b/gjs/compat.h
@@ -59,7 +59,7 @@ G_BEGIN_DECLS
     _Pragma("GCC warning \"JS_GetGlobalObject is deprecated. Use JS_GetGlobalForObject() or 
JS_GetGlobalForScopeChain() instead.\"") \
     gjs_get_global_object(cx)
 
-static JSBool G_GNUC_UNUSED G_GNUC_DEPRECATED_FOR(JS::NumberValue)
+static bool G_GNUC_UNUSED G_GNUC_DEPRECATED_FOR(JS::NumberValue)
 JS_NewNumberValue(JSContext *cx,
                   double     d,
                   JS::Value *rval)
diff --git a/gjs/context.cpp b/gjs/context.cpp
index dcaee23..053a5ae 100644
--- a/gjs/context.cpp
+++ b/gjs/context.cpp
@@ -114,7 +114,7 @@ gjs_log(JSContext *context,
 
     if (argc != 1) {
         gjs_throw(context, "Must pass a single argument to log()");
-        return JS_FALSE;
+        return false;
     }
 
     JS_BeginRequest(context);
@@ -130,12 +130,12 @@ gjs_log(JSContext *context,
     if (jstr == NULL) {
         g_message("JS LOG: <cannot convert value to string>");
         JS_EndRequest(context);
-        return JS_TRUE;
+        return true;
     }
 
     if (!gjs_string_to_utf8(context, JS::StringValue(jstr), &s)) {
         JS_EndRequest(context);
-        return JS_FALSE;
+        return false;
     }
 
     g_message("JS LOG: %s", s);
@@ -143,7 +143,7 @@ gjs_log(JSContext *context,
 
     JS_EndRequest(context);
     argv.rval().setUndefined();
-    return JS_TRUE;
+    return true;
 }
 
 static JSBool
@@ -157,7 +157,7 @@ gjs_log_error(JSContext *context,
 
     if ((argc != 1 && argc != 2) || !argv[0].isObject()) {
         gjs_throw(context, "Must pass an exception and optionally a message to logError()");
-        return JS_FALSE;
+        return false;
     }
 
     JS_BeginRequest(context);
@@ -178,10 +178,10 @@ gjs_log_error(JSContext *context,
 
     JS_EndRequest(context);
     argv.rval().setUndefined();
-    return JS_TRUE;
+    return true;
 }
 
-static JSBool
+static bool
 gjs_print_parse_args(JSContext *context,
                      JS::CallArgs &argv,
                      char     **buffer)
@@ -211,7 +211,7 @@ gjs_print_parse_args(JSContext *context,
             if (!gjs_string_to_utf8(context, JS::StringValue(jstr), &s)) {
                 JS_EndRequest(context);
                 g_string_free(str, TRUE);
-                return JS_FALSE;
+                return false;
             }
 
             g_string_append(str, s);
@@ -223,14 +223,14 @@ gjs_print_parse_args(JSContext *context,
             *buffer = g_string_free(str, TRUE);
             if (!*buffer)
                 *buffer = g_strdup("<invalid string>");
-            return JS_TRUE;
+            return true;
         }
 
     }
     *buffer = g_string_free(str, FALSE);
 
     JS_EndRequest(context);
-    return JS_TRUE;
+    return true;
 }
 
 static JSBool
@@ -249,7 +249,7 @@ gjs_print(JSContext *context,
     g_free(buffer);
 
     argv.rval().setUndefined();
-    return JS_TRUE;
+    return true;
 }
 
 static JSBool
@@ -268,7 +268,7 @@ gjs_printerr(JSContext *context,
     g_free(buffer);
 
     argv.rval().setUndefined();
-    return JS_TRUE;
+    return true;
 }
 
 static void
diff --git a/gjs/coverage.cpp b/gjs/coverage.cpp
index 92b3beb..08eae48 100644
--- a/gjs/coverage.cpp
+++ b/gjs/coverage.cpp
@@ -591,7 +591,7 @@ get_functions_for(JSContext        *context,
 static void
 init_covered_branch(GjsCoverageBranch *branch,
                     unsigned int       point,
-                    JSBool             was_hit,
+                    bool               was_hit,
                     GArray            *exits)
 {
     branch->point = point;
@@ -674,7 +674,7 @@ convert_and_insert_branch_info(GArray    *array,
         branch_point = branch_point_value.toInt32();
 
         JS::Value was_hit_value;
-        JSBool was_hit;
+        bool was_hit;
 
         if (!JS_GetProperty(context, object, "hit", &was_hit_value) ||
             !was_hit_value.isBoolean()) {
@@ -1181,7 +1181,7 @@ gjs_write_cache_to_path(const char *path,
     return TRUE;
 }
 
-static JSBool
+static bool
 coverage_statistics_has_stale_cache(GjsCoverage *coverage)
 {
     GjsCoveragePrivate *priv = (GjsCoveragePrivate *) gjs_coverage_get_instance_private(coverage);
@@ -1345,7 +1345,7 @@ coverage_log(JSContext *context,
 
     if (argc != 1) {
         gjs_throw(context, "Must pass a single argument to log()");
-        return JS_FALSE;
+        return false;
     }
 
     JSAutoRequest ar(context);
@@ -1353,7 +1353,7 @@ coverage_log(JSContext *context,
     if (!g_getenv("GJS_SHOW_COVERAGE_MESSAGES")) {
         _suppressed_coverage_messages_count++;
         argv.rval().setUndefined();
-        return JS_TRUE;
+        return true;
     }
 
     /* JS_ValueToString might throw, in which we will only
@@ -1366,18 +1366,18 @@ coverage_log(JSContext *context,
 
     if (jstr == NULL) {
         g_message("JS LOG: <cannot convert value to string>");
-        return JS_TRUE;
+        return true;
     }
 
     if (!gjs_string_to_utf8(context, JS::StringValue(jstr), &s)) {
-        return JS_FALSE;
+        return false;
     }
 
     g_message("JS COVERAGE MESSAGE: %s", s);
     g_free(s);
 
     argv.rval().setUndefined();
-    return JS_TRUE;
+    return true;
 }
 
 static char *
@@ -1416,7 +1416,7 @@ coverage_get_file_modification_time(JSContext *context,
     JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
     JSRuntime    *runtime = JS_GetRuntime(context);
     GTimeVal mtime;
-    JSBool ret = JS_FALSE;
+    bool ret = false;
     char *filename = get_filename_from_filename_as_js_string(context, args);
 
     if (!filename)
@@ -1434,7 +1434,7 @@ coverage_get_file_modification_time(JSContext *context,
         args.rval().setNull();
     }
 
-    ret = JS_TRUE;
+    ret = true;
 
 out:
     g_free(filename);
@@ -1449,17 +1449,16 @@ coverage_get_file_checksum(JSContext *context,
     JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
     JSRuntime    *runtime = JS_GetRuntime(context);
     GTimeVal mtime;
-    JSBool ret = JS_FALSE;
     char *filename = get_filename_from_filename_as_js_string(context, args);
 
     if (!filename)
-        return JS_FALSE;
+        return false;
 
     char *checksum = gjs_get_path_checksum(filename);
 
     if (!checksum) {
         gjs_throw(context, "Failed to read %s and get its checksum", filename);
-        return JS_FALSE;
+        return false;
     }
 
     JS::RootedString rooted_checksum(runtime, JS_NewStringCopyZ(context,
@@ -1468,7 +1467,7 @@ coverage_get_file_checksum(JSContext *context,
 
     g_free(filename);
     g_free(checksum);
-    return JS_TRUE;
+    return true;
 }
 
 static JSBool
@@ -1476,7 +1475,7 @@ coverage_get_file_contents(JSContext *context,
                            unsigned   argc,
                            JS::Value *vp)
 {
-    JSBool ret = JS_FALSE;
+    bool ret = false;
     JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
     char *filename = NULL;
     GFile *file = NULL;
@@ -1502,7 +1501,7 @@ coverage_get_file_contents(JSContext *context,
     }
 
     args.rval().setString(JS_NewStringCopyN(context, script, script_len));
-    ret = JS_TRUE;
+    ret = true;
 
  out:
     g_clear_error(&error);
diff --git a/gjs/gi.cpp b/gjs/gi.cpp
index 6ff4847..a960f01 100644
--- a/gjs/gi.cpp
+++ b/gjs/gi.cpp
@@ -31,7 +31,7 @@
 #include "gjs/compat.h"
 #include "gi/repo.h"
 
-JSBool
+bool
 gjs_define_gi_stuff(JSContext      *context,
                     JSObject      **module_out)
 {
diff --git a/gjs/gi.h b/gjs/gi.h
index 837d03d..44df221 100644
--- a/gjs/gi.h
+++ b/gjs/gi.h
@@ -30,9 +30,9 @@
 
 G_BEGIN_DECLS
 
-JSBool        gjs_define_gi_stuff     (JSContext      *context,
+bool          gjs_define_gi_stuff     (JSContext      *context,
                                        JSObject      **module_out);
-JSBool        gjs_define_private_gi_stuff   (JSContext     *context,
+bool          gjs_define_private_gi_stuff   (JSContext     *context,
                                              JSObject     **module_out);
 
 G_END_DECLS
diff --git a/gjs/importer.cpp b/gjs/importer.cpp
index e35f369..a3f0c47 100644
--- a/gjs/importer.cpp
+++ b/gjs/importer.cpp
@@ -51,7 +51,7 @@ extern struct JSClass gjs_importer_class;
 
 GJS_DEFINE_PRIV_FROM_JS(Importer, gjs_importer_class)
 
-static JSBool
+static bool
 define_meta_properties(JSContext  *context,
                        JSObject   *module_obj,
                        const char *full_path,
@@ -77,7 +77,7 @@ define_meta_properties(JSContext  *context,
                                 * this symbol to any other object for example.
                                 */
                                JSPROP_READONLY | JSPROP_PERMANENT))
-            return JS_FALSE;
+            return false;
     }
 
     if (!JS_DefineProperty(context, module_obj,
@@ -90,7 +90,7 @@ define_meta_properties(JSContext  *context,
                             * this symbol to any other object for example.
                             */
                            JSPROP_READONLY | JSPROP_PERMANENT))
-        return JS_FALSE;
+        return false;
 
     if (!JS_DefineProperty(context, module_obj,
                            "__parentModule__",
@@ -100,12 +100,12 @@ define_meta_properties(JSContext  *context,
                             * this symbol to any other object for example.
                             */
                            JSPROP_READONLY | JSPROP_PERMANENT))
-        return JS_FALSE;
+        return false;
 
-    return JS_TRUE;
+    return true;
 }
 
-static JSBool
+static bool
 import_directory(JSContext   *context,
                  JSObject    *obj,
                  const char  *name,
@@ -122,13 +122,10 @@ import_directory(JSContext   *context,
      * this always succeeds.
      */
     importer = gjs_define_importer(context, obj, name, full_paths, FALSE);
-    if (importer == NULL)
-        return JS_FALSE;
-
-    return JS_TRUE;
+    return importer != NULL;
 }
 
-static JSBool
+static bool
 define_import(JSContext  *context,
               JSObject   *obj,
               JSObject   *module_obj,
@@ -141,16 +138,16 @@ define_import(JSContext  *context,
         gjs_debug(GJS_DEBUG_IMPORTER,
                   "Failed to define '%s' in importer",
                   name);
-        return JS_FALSE;
+        return false;
     }
 
-    return JS_TRUE;
+    return true;
 }
 
 /* Make the property we set in define_import permament;
  * we do this after the import succesfully completes.
  */
-static JSBool
+static bool
 seal_import(JSContext  *context,
             JSObject   *obj,
             const char *name)
@@ -163,7 +160,7 @@ seal_import(JSContext  *context,
         gjs_debug(GJS_DEBUG_IMPORTER,
                   "Failed to get attributes to seal '%s' in importer",
                   name);
-        return JS_FALSE;
+        return false;
     }
 
     attrs |= JSPROP_PERMANENT;
@@ -173,10 +170,10 @@ seal_import(JSContext  *context,
         gjs_debug(GJS_DEBUG_IMPORTER,
                   "Failed to set attributes to seal '%s' in importer",
                   name);
-        return JS_FALSE;
+        return false;
     }
 
-    return JS_TRUE;
+    return true;
 }
 
 /* An import failed. Delete the property pointing to the import
@@ -213,13 +210,13 @@ cancel_import(JSContext  *context,
     }
 }
 
-static JSBool
+static bool
 import_native_file(JSContext  *context,
                    JSObject   *obj,
                    const char *name)
 {
     JSObject *module_obj;
-    JSBool retval = JS_FALSE;
+    bool retval = false;
 
     gjs_debug(GJS_DEBUG_IMPORTER, "Importing '%s'", name);
 
@@ -243,7 +240,7 @@ import_native_file(JSContext  *context,
                            NULL, NULL, GJS_MODULE_PROP_FLAGS))
         goto out;
 
-    retval = JS_TRUE;
+    retval = true;
 
  out:
     return retval;
@@ -255,13 +252,13 @@ create_module_object(JSContext *context)
     return JS_NewObject(context, NULL, NULL, NULL);
 }
 
-static JSBool
+static bool
 import_file(JSContext  *context,
             const char *name,
             GFile      *file,
             JSObject   *module_obj)
 {
-    JSBool ret = JS_FALSE;
+    bool ret = false;
     char *script = NULL;
     char *full_path = NULL;
     gsize script_len = 0;
@@ -288,7 +285,7 @@ import_file(JSContext  *context,
                              full_path, NULL))
         goto out;
 
-    ret = JS_TRUE;
+    ret = true;
 
  out:
     g_free(script);
@@ -375,14 +372,14 @@ load_module_elements(JSContext *context,
     }
 }
 
-static JSBool
+static bool
 import_file_on_module(JSContext  *context,
                       JSObject   *obj,
                       const char *name,
                       GFile      *file)
 {
     JSObject *module_obj;
-    JSBool retval = JS_FALSE;
+    bool retval = false;
     char *full_path = NULL;
 
     module_obj = create_module_object (context);
@@ -400,7 +397,7 @@ import_file_on_module(JSContext  *context,
     if (!seal_import(context, obj, name))
         goto out;
 
-    retval = JS_TRUE;
+    retval = true;
 
  out:
     if (!retval)
@@ -410,7 +407,7 @@ import_file_on_module(JSContext  *context,
     return retval;
 }
 
-static JSBool
+static bool
 do_import(JSContext  *context,
           JSObject   *obj,
           Importer   *priv,
@@ -424,7 +421,7 @@ do_import(JSContext  *context,
     JSObject *module_obj = NULL;
     guint32 search_path_len;
     guint32 i;
-    JSBool result;
+    bool result;
     GPtrArray *directories;
     jsid search_path_name;
     GFile *gfile;
@@ -432,27 +429,27 @@ do_import(JSContext  *context,
 
     search_path_name = gjs_context_get_const_string(context, GJS_STRING_SEARCH_PATH);
     if (!gjs_object_require_property(context, obj, "importer", search_path_name, &search_path_val)) {
-        return JS_FALSE;
+        return false;
     }
 
     if (!search_path_val.isObject()) {
         gjs_throw(context, "searchPath property on importer is not an object");
-        return JS_FALSE;
+        return false;
     }
 
     search_path = &search_path_val.toObject();
 
     if (!JS_IsArrayObject(context, search_path)) {
         gjs_throw(context, "searchPath property on importer is not an array");
-        return JS_FALSE;
+        return false;
     }
 
     if (!JS_GetArrayLength(context, search_path, &search_path_len)) {
         gjs_throw(context, "searchPath array has no length");
-        return JS_FALSE;
+        return false;
     }
 
-    result = JS_FALSE;
+    result = false;
 
     filename = g_strdup_printf("%s.js", name);
     full_path = NULL;
@@ -464,7 +461,7 @@ do_import(JSContext  *context,
         import_native_file(context, obj, name)) {
         gjs_debug(GJS_DEBUG_IMPORTER,
                   "successfully imported module '%s'", name);
-        result = JS_TRUE;
+        result = true;
         goto out;
     }
 
@@ -516,7 +513,7 @@ do_import(JSContext  *context,
                                       name, obj_val,
                                       NULL, NULL,
                                       GJS_MODULE_PROP_FLAGS & ~JSPROP_PERMANENT)) {
-                    result = JS_TRUE;
+                    result = true;
                     goto out;
                 }
             }
@@ -572,7 +569,7 @@ do_import(JSContext  *context,
         if (import_file_on_module (context, obj, name, gfile)) {
             gjs_debug(GJS_DEBUG_IMPORTER,
                       "successfully imported module '%s'", name);
-            result = JS_TRUE;
+            result = true;
         }
 
         g_object_unref(gfile);
@@ -592,7 +589,7 @@ do_import(JSContext  *context,
                              (const char**) directories->pdata)) {
             gjs_debug(GJS_DEBUG_IMPORTER,
                       "successfully imported directory '%s'", name);
-            result = JS_TRUE;
+            result = true;
         }
     }
 
@@ -659,7 +656,7 @@ importer_iterator_free(ImporterIterator *iter)
  * then on its prototype.
  *
  */
-static JSBool
+static bool
 importer_new_enumerate(JSContext  *context,
                        JS::HandleObject object,
                        JSIterateOp enum_op,
@@ -686,27 +683,27 @@ importer_new_enumerate(JSContext  *context,
 
         if (!priv)
             /* we are enumerating the prototype properties */
-            return JS_TRUE;
+            return true;
 
         search_path_name = gjs_context_get_const_string(context, GJS_STRING_SEARCH_PATH);
         if (!gjs_object_require_property(context, object, "importer", search_path_name, &search_path_val))
-            return JS_FALSE;
+            return false;
 
         if (!search_path_val.isObject()) {
             gjs_throw(context, "searchPath property on importer is not an object");
-            return JS_FALSE;
+            return false;
         }
 
         search_path = &search_path_val.toObject();
 
         if (!JS_IsArrayObject(context, search_path)) {
             gjs_throw(context, "searchPath property on importer is not an array");
-            return JS_FALSE;
+            return false;
         }
 
         if (!JS_GetArrayLength(context, search_path, &search_path_len)) {
             gjs_throw(context, "searchPath array has no length");
-            return JS_FALSE;
+            return false;
         }
 
         iter = importer_iterator_new();
@@ -724,7 +721,7 @@ importer_new_enumerate(JSContext  *context,
                  * means no element found
                  */
                 importer_iterator_free(iter);
-                return JS_FALSE;
+                return false;
             }
 
             if (elem.isUndefined())
@@ -733,12 +730,12 @@ importer_new_enumerate(JSContext  *context,
             if (!elem.isString()) {
                 gjs_throw(context, "importer searchPath contains non-string");
                 importer_iterator_free(iter);
-                return JS_FALSE;
+                return false;
             }
 
             if (!gjs_string_to_utf8(context, elem, &dirname)) {
                 importer_iterator_free(iter);
-                return JS_FALSE; /* Error message already set */
+                return false; /* Error message already set */
             }
 
             init_path = g_build_filename(dirname, MODULE_INIT_FILENAME,
@@ -796,7 +793,7 @@ importer_new_enumerate(JSContext  *context,
         JS::Value element_val;
 
         if (statep.isNull()) /* Iterating prototype */
-            return JS_TRUE;
+            return true;
 
         iter = (ImporterIterator*) statep.get().toPrivate();
 
@@ -806,11 +803,11 @@ importer_new_enumerate(JSContext  *context,
                                                            iter->index++),
                                          -1,
                                          &element_val))
-                return JS_FALSE;
+                return false;
 
             jsid id;
             if (!JS_ValueToId(context, element_val, &id))
-                return JS_FALSE;
+                return false;
             idp.set(id);
 
             break;
@@ -829,7 +826,7 @@ importer_new_enumerate(JSContext  *context,
     }
     }
 
-    return JS_TRUE;
+    return true;
 }
 
 /*
@@ -845,7 +842,7 @@ importer_new_enumerate(JSContext  *context,
  * was not resolved; and non-null, referring to obj or one of its prototypes,
  * if id was resolved.
  */
-static JSBool
+static bool
 importer_new_resolve(JSContext *context,
                      JS::HandleObject obj,
                      JS::HandleId id,
@@ -854,15 +851,15 @@ importer_new_resolve(JSContext *context,
 {
     Importer *priv;
     char *name;
-    JSBool ret = JS_TRUE;
+    bool ret = true;
     jsid module_init_name;
 
     module_init_name = gjs_context_get_const_string(context, GJS_STRING_MODULE_INIT);
     if (id == module_init_name)
-        return JS_TRUE;
+        return true;
 
     if (!gjs_get_string_id(context, id, &name))
-        return JS_FALSE;
+        return false;
 
     /* let Object.prototype resolve these */
     if (strcmp(name, "valueOf") == 0 ||
@@ -880,7 +877,7 @@ importer_new_resolve(JSContext *context,
     if (do_import(context, obj, priv, name)) {
         objp.set(obj);
     } else {
-        ret = JS_FALSE;
+        ret = false;
     }
     JS_EndRequest(context);
 
@@ -1116,7 +1113,7 @@ gjs_define_importer(JSContext    *context,
  * would basically be a bug, but checking for that is a lot of code so
  * we just ignore all calls after the first and hope the args are the same.
  */
-JSBool
+bool
 gjs_create_root_importer(JSContext   *context,
                          const char **initial_search_path,
                          gboolean     add_standard_search_path)
@@ -1132,7 +1129,7 @@ gjs_create_root_importer(JSContext   *context,
                   "Someone else already created root importer, ignoring second request");
 
         JS_EndRequest(context);
-        return JS_TRUE;
+        return true;
     }
 
     importer = JS::ObjectValue(*gjs_create_importer(context, "imports",
@@ -1142,18 +1139,18 @@ gjs_create_root_importer(JSContext   *context,
     gjs_set_global_slot(context, GJS_GLOBAL_SLOT_IMPORTS, importer);
 
     JS_EndRequest(context);
-    return JS_TRUE;
+    return true;
 }
 
-JSBool
+bool
 gjs_define_root_importer_object(JSContext        *context,
                                 JS::HandleObject  in_object,
                                 JS::HandleObject  root_importer)
 {
-    JSBool success;
+    bool success;
     jsid imports_name;
 
-    success = JS_FALSE;
+    success = false;
     JS_BeginRequest(context);
 
     JS::RootedValue importer (JS_GetRuntime(context),
@@ -1168,13 +1165,13 @@ gjs_define_root_importer_object(JSContext        *context,
         goto fail;
     }
 
-    success = JS_TRUE;
+    success = true;
  fail:
     JS_EndRequest(context);
     return success;
 }
 
-JSBool
+bool
 gjs_define_root_importer(JSContext   *context,
                          JSObject    *in_object)
 {
diff --git a/gjs/importer.h b/gjs/importer.h
index e49fe96..dc3bf4b 100644
--- a/gjs/importer.h
+++ b/gjs/importer.h
@@ -33,12 +33,12 @@
 
 G_BEGIN_DECLS
 
-JSBool    gjs_create_root_importer (JSContext   *context,
+bool      gjs_create_root_importer (JSContext   *context,
                                     const char **initial_search_path,
                                     gboolean     add_standard_search_path);
-JSBool    gjs_define_root_importer (JSContext   *context,
+bool      gjs_define_root_importer (JSContext   *context,
                                     JSObject    *in_object);
-JSBool    gjs_define_root_importer_object(JSContext        *context,
+bool      gjs_define_root_importer_object(JSContext        *context,
                                           JS::HandleObject  in_object,
                                           JS::HandleObject  root_importer);
 JSObject* gjs_define_importer      (JSContext   *context,
diff --git a/gjs/jsapi-dynamic-class.cpp b/gjs/jsapi-dynamic-class.cpp
index e46d1b0..c87fc9b 100644
--- a/gjs/jsapi-dynamic-class.cpp
+++ b/gjs/jsapi-dynamic-class.cpp
@@ -49,7 +49,7 @@ gjs_new_object_for_constructor(JSContext *context,
     return JS_NewObjectForConstructor(context, clasp, vp);
 }
 
-JSBool
+bool
 gjs_init_class_dynamic(JSContext       *context,
                        JSObject        *in_object,
                        JSObject        *parent_proto,
@@ -72,7 +72,7 @@ gjs_init_class_dynamic(JSContext       *context,
     JSObject * volatile constructor;
     JSFunction * volatile constructor_fun;
     char *full_function_name = NULL;
-    JSBool res = JS_FALSE;
+    bool res = false;
 
     /* Without a name, JS_NewObject fails */
     g_assert (clasp->name != NULL);
@@ -141,7 +141,7 @@ gjs_init_class_dynamic(JSContext       *context,
     if (prototype_p)
         *prototype_p = prototype;
 
-    res = JS_TRUE;
+    res = true;
 
     prototype = NULL;
     constructor_fun = NULL;
@@ -163,11 +163,11 @@ format_dynamic_class_name (const char *name)
         return name;
 }
 
-JSBool
+bool
 gjs_typecheck_instance(JSContext *context,
                        JSObject  *obj,
                        JSClass   *static_clasp,
-                       JSBool     throw_error)
+                       bool       throw_error)
 {
     if (!JS_InstanceOf(context, obj, static_clasp, NULL)) {
         if (throw_error) {
@@ -178,10 +178,10 @@ gjs_typecheck_instance(JSContext *context,
                              obj, static_clasp->name, format_dynamic_class_name (obj_class->name));
         }
 
-        return JS_FALSE;
+        return false;
     }
 
-    return JS_TRUE;
+    return true;
 }
 
 JSObject*
diff --git a/gjs/jsapi-util-error.cpp b/gjs/jsapi-util-error.cpp
index 6f61b19..b9dd1a8 100644
--- a/gjs/jsapi-util-error.cpp
+++ b/gjs/jsapi-util-error.cpp
@@ -48,7 +48,7 @@ gjs_throw_valist(JSContext       *context,
                  va_list          args)
 {
     char *s;
-    JSBool result;
+    bool result;
     JS::Value v_constructor, v_message;
     JSObject *err_obj;
 
@@ -75,7 +75,7 @@ gjs_throw_valist(JSContext       *context,
         return;
     }
 
-    result = JS_FALSE;
+    result = false;
 
     if (!gjs_string_from_utf8(context, s, -1, &v_message)) {
         JS_ReportError(context, "Failed to copy exception string");
@@ -92,7 +92,7 @@ gjs_throw_valist(JSContext       *context,
     err_obj = JS_New(context, &v_constructor.toObject(), 1, &v_message);
     JS_SetPendingException(context, JS::ObjectOrNullValue(err_obj));
 
-    result = JS_TRUE;
+    result = true;
 
  out:
 
diff --git a/gjs/jsapi-util-string.cpp b/gjs/jsapi-util-string.cpp
index c193178..3d9af12 100644
--- a/gjs/jsapi-util-string.cpp
+++ b/gjs/jsapi-util-string.cpp
@@ -43,7 +43,7 @@ gjs_string_to_utf8 (JSContext      *context,
         gjs_throw(context,
                   "Value is not a string, cannot convert to UTF-8");
         JS_EndRequest(context);
-        return JS_FALSE;
+        return false;
     }
 
     str = value.toString();
@@ -51,7 +51,7 @@ gjs_string_to_utf8 (JSContext      *context,
     len = JS_GetStringEncodingLength(context, str);
     if (len == (gsize)(-1)) {
         JS_EndRequest(context);
-        return JS_FALSE;
+        return false;
     }
 
     if (utf8_string_p) {
@@ -61,10 +61,10 @@ gjs_string_to_utf8 (JSContext      *context,
 
     JS_EndRequest(context);
 
-    return JS_TRUE;
+    return true;
 }
 
-JSBool
+bool
 gjs_string_from_utf8(JSContext  *context,
                      const char *utf8_string,
                      gssize      n_bytes,
@@ -91,7 +91,7 @@ gjs_string_from_utf8(JSContext  *context,
                   "JS string: %s",
                   error->message);
                   g_error_free(error);
-        return JS_FALSE;
+        return false;
     }
 
     JS_BeginRequest(context);
@@ -118,7 +118,7 @@ gjs_string_to_filename(JSContext      *context,
 
     if (!gjs_string_to_utf8(context, filename_val, &tmp)) {
         /* exception already set */
-        return JS_FALSE;
+        return false;
     }
 
     error = NULL;
@@ -134,7 +134,7 @@ gjs_string_to_filename(JSContext      *context,
     return TRUE;
 }
 
-JSBool
+bool
 gjs_string_from_filename(JSContext  *context,
                          const char *filename_string,
                          gssize      n_bytes,
@@ -154,15 +154,15 @@ gjs_string_from_filename(JSContext  *context,
                   error->message);
         g_error_free(error);
         g_free(utf8_string);
-        return JS_FALSE;
+        return false;
     }
 
     if (!gjs_string_from_utf8(context, utf8_string, written, value_p))
-        return JS_FALSE;
+        return false;
 
     g_free(utf8_string);
 
-    return JS_TRUE;
+    return true;
 }
 
 /**
@@ -176,16 +176,16 @@ gjs_string_from_filename(JSContext  *context,
  * contained in @value.
  * Throws a JS exception if value is not a string.
  *
- * Returns: JS_FALSE if exception thrown
+ * Returns: false if exception thrown
  **/
-JSBool
+bool
 gjs_string_get_uint16_data(JSContext       *context,
                            JS::Value        value,
                            guint16        **data_p,
                            gsize           *len_p)
 {
     const jschar *js_data;
-    JSBool retval = JS_FALSE;
+    bool retval = false;
 
     JS_BeginRequest(context);
 
@@ -201,7 +201,7 @@ gjs_string_get_uint16_data(JSContext       *context,
 
     *data_p = (guint16*) g_memdup(js_data, sizeof(*js_data)*(*len_p));
 
-    retval = JS_TRUE;
+    retval = true;
 out:
     JS_EndRequest(context);
     return retval;
@@ -218,7 +218,7 @@ out:
  *
  * Returns: true if *name_p is non-%NULL
  **/
-JSBool
+bool
 gjs_get_string_id (JSContext       *context,
                    jsid             id,
                    char           **name_p)
@@ -226,13 +226,13 @@ gjs_get_string_id (JSContext       *context,
     JS::Value id_val;
 
     if (!JS_IdToValue(context, id, &id_val))
-        return JS_FALSE;
+        return false;
 
     if (id_val.isString()) {
         return gjs_string_to_utf8(context, id_val, name_p);
     } else {
         *name_p = NULL;
-        return JS_FALSE;
+        return false;
     }
 }
 
diff --git a/gjs/jsapi-util.cpp b/gjs/jsapi-util.cpp
index 64910ec..1751bef 100644
--- a/gjs/jsapi-util.cpp
+++ b/gjs/jsapi-util.cpp
@@ -155,12 +155,12 @@ gjs_object_require_property(JSContext       *context,
         *value_p = value;
 
     if (G_UNLIKELY (!JS_GetPropertyById(context, obj, property_name, &value)))
-        return JS_FALSE;
+        return false;
 
     if (G_LIKELY (!value.isUndefined())) {
         if (value_p)
             *value_p = value;
-        return JS_TRUE;
+        return true;
     }
 
     /* remember gjs_throw() is a no-op if JS_GetProperty()
@@ -179,7 +179,7 @@ gjs_object_require_property(JSContext       *context,
                   name, obj);
 
     g_free(name);
-    return JS_FALSE;
+    return false;
 }
 
 void
@@ -473,7 +473,7 @@ gjs_explain_scope(JSContext  *context,
     JS_EndRequest(context);
 }
 
-JSBool
+bool
 gjs_log_exception_full(JSContext *context,
                        JS::Value  exc,
                        JSString  *message)
@@ -582,15 +582,15 @@ gjs_log_exception_full(JSContext *context,
 
     JS_EndRequest(context);
 
-    return JS_TRUE;
+    return true;
 }
 
-static JSBool
+static bool
 log_and_maybe_keep_exception(JSContext  *context,
                              gboolean    keep)
 {
     JS::Value exc = JS::UndefinedValue();
-    JSBool retval = JS_FALSE;
+    bool retval = false;
 
     JS_BeginRequest(context);
 
@@ -608,7 +608,7 @@ log_and_maybe_keep_exception(JSContext  *context,
     if (keep)
         JS_SetPendingException(context, exc);
 
-    retval = JS_TRUE;
+    retval = true;
 
  out:
     JS_RemoveValueRoot(context, &exc);
@@ -618,13 +618,13 @@ log_and_maybe_keep_exception(JSContext  *context,
     return retval;
 }
 
-JSBool
+bool
 gjs_log_exception(JSContext  *context)
 {
     return log_and_maybe_keep_exception(context, FALSE);
 }
 
-JSBool
+bool
 gjs_log_and_keep_exception(JSContext *context)
 {
     return log_and_maybe_keep_exception(context, TRUE);
@@ -676,11 +676,11 @@ try_to_chain_stack_trace(JSContext *src_context,
     JS_EndRequest(src_context);
 }
 
-JSBool
+bool
 gjs_move_exception(JSContext      *src_context,
                    JSContext      *dest_context)
 {
-    JSBool success;
+    bool success;
 
     JS_BeginRequest(src_context);
     JS_BeginRequest(dest_context);
@@ -696,9 +696,9 @@ gjs_move_exception(JSContext      *src_context,
             JS_SetPendingException(dest_context, exc);
             JS_ClearPendingException(src_context);
         }
-        success = JS_TRUE;
+        success = true;
     } else {
-        success = JS_FALSE;
+        success = false;
     }
 
     JS_EndRequest(dest_context);
@@ -707,7 +707,7 @@ gjs_move_exception(JSContext      *src_context,
     return success;
 }
 
-JSBool
+bool
 gjs_call_function_value(JSContext      *context,
                         JSObject       *obj,
                         JS::Value       fval,
@@ -715,7 +715,7 @@ gjs_call_function_value(JSContext      *context,
                         JS::Value      *argv,
                         JS::Value      *rval)
 {
-    JSBool result;
+    bool result;
 
     JS_BeginRequest(context);
 
@@ -729,7 +729,7 @@ gjs_call_function_value(JSContext      *context,
     return result;
 }
 
-static JSBool
+static bool
 log_prop(JSContext  *context,
          JSObject   *obj,
          JS::Value   id,
@@ -754,10 +754,10 @@ log_prop(JSContext  *context,
                   what);
     }
 
-    return JS_TRUE;
+    return true;
 }
 
-JSBool
+bool
 gjs_get_prop_verbose_stub(JSContext *context,
                           JSObject  *obj,
                           JS::Value  id,
@@ -766,7 +766,7 @@ gjs_get_prop_verbose_stub(JSContext *context,
     return log_prop(context, obj, id, value_p, "get");
 }
 
-JSBool
+bool
 gjs_set_prop_verbose_stub(JSContext *context,
                           JSObject  *obj,
                           JS::Value  id,
@@ -775,7 +775,7 @@ gjs_set_prop_verbose_stub(JSContext *context,
     return log_prop(context, obj, id, value_p, "set");
 }
 
-JSBool
+bool
 gjs_add_prop_verbose_stub(JSContext *context,
                           JSObject  *obj,
                           JS::Value  id,
@@ -784,7 +784,7 @@ gjs_add_prop_verbose_stub(JSContext *context,
     return log_prop(context, obj, id, value_p, "add");
 }
 
-JSBool
+bool
 gjs_delete_prop_verbose_stub(JSContext *context,
                              JSObject  *obj,
                              JS::Value  id,
@@ -835,18 +835,18 @@ gjs_get_type_name(JS::Value value)
  *   rounded to the nearest 64-bit integer. Like JS_ValueToInt32(),
  *   undefined throws, but null => 0, false => 0, true => 1.
  */
-JSBool
+bool
 gjs_value_to_int64(JSContext      *context,
                    const JS::Value val,
                    gint64         *result)
 {
     if (val.isInt32()) {
         *result = val.toInt32();
-        return JS_TRUE;
+        return true;
     } else {
         double value_double;
         if (!JS_ValueToNumber(context, val, &value_double))
-            return JS_FALSE;
+            return false;
 
         if (isnan(value_double) ||
             value_double < G_MININT64 ||
@@ -854,15 +854,15 @@ gjs_value_to_int64(JSContext      *context,
 
             gjs_throw(context,
                       "Value is not a valid 64-bit integer");
-            return JS_FALSE;
+            return false;
         }
 
         *result = (gint64)(value_double + 0.5);
-        return JS_TRUE;
+        return true;
     }
 }
 
-static JSBool
+static bool
 gjs_parse_args_valist (JSContext  *context,
                        const char *function_name,
                        const char *format,
@@ -938,8 +938,8 @@ gjs_parse_args_valist (JSContext  *context,
         argname = va_arg (args, char *);
         arg_location = va_arg (args, gpointer);
 
-        g_return_val_if_fail (argname != NULL, JS_FALSE);
-        g_return_val_if_fail (arg_location != NULL, JS_FALSE);
+        g_return_val_if_fail (argname != NULL, false);
+        g_return_val_if_fail (arg_location != NULL, false);
 
         js_value = argv[consumed_args];
 
@@ -1053,7 +1053,7 @@ gjs_parse_args_valist (JSContext  *context,
     }
 
     JS_EndRequest(context);
-    return JS_TRUE;
+    return true;
 
  error_unwind:
     /* We still own the strings in the error case, free any we converted */
@@ -1061,7 +1061,7 @@ gjs_parse_args_valist (JSContext  *context,
         g_free (unwind_strings[i]);
     }
     JS_EndRequest(context);
-    return JS_FALSE;
+    return false;
 }
 
 /**
@@ -1098,7 +1098,7 @@ gjs_parse_args_valist (JSContext  *context,
  * A prefix character '?' means that the next value may be null, in
  * which case the C value %NULL is returned.
  */
-JSBool
+bool
 gjs_parse_args (JSContext  *context,
                 const char *function_name,
                 const char *format,
@@ -1107,14 +1107,14 @@ gjs_parse_args (JSContext  *context,
                 ...)
 {
     va_list args;
-    JSBool ret;
+    bool ret;
     va_start (args, argv);
     ret = gjs_parse_args_valist (context, function_name, format, argc, argv, args);
     va_end (args);
     return ret;
 }
 
-JSBool
+bool
 gjs_parse_call_args (JSContext    *context,
                      const char   *function_name,
                      const char   *format,
@@ -1122,7 +1122,7 @@ gjs_parse_call_args (JSContext    *context,
                      ...)
 {
     va_list args;
-    JSBool ret;
+    bool ret;
     va_start (args, call_args);
     ret = gjs_parse_args_valist (context, function_name, format, call_args.length(), call_args.array(), 
args);
     va_end (args);
@@ -1286,7 +1286,7 @@ gjs_strip_unix_shebang(const char  *script,
     return script;
 }
 
-JSBool
+bool
 gjs_eval_with_scope(JSContext    *context,
                     JSObject     *object,
                     const char   *script,
@@ -1308,7 +1308,7 @@ gjs_eval_with_scope(JSContext    *context,
     /* log and clear exception if it's set (should not be, normally...) */
     if (JS_IsExceptionPending(context)) {
         g_warning("gjs_eval_in_scope called with a pending exception");
-        return JS_FALSE;
+        return false;
     }
 
     if (!object)
@@ -1322,14 +1322,14 @@ gjs_eval_with_scope(JSContext    *context,
     js::RootedObject rootedObj(context, object);
 
     if (!JS::Evaluate(context, rootedObj, options, script, script_len, &retval))
-        return JS_FALSE;
+        return false;
 
     gjs_schedule_gc_if_needed(context);
 
     if (JS_IsExceptionPending(context)) {
-        g_warning("EvaluateScript returned JS_TRUE but exception was pending; "
-                  "did somebody call gjs_throw() without returning JS_FALSE?");
-        return JS_FALSE;
+        g_warning("EvaluateScript returned true but exception was pending; "
+                  "did somebody call gjs_throw() without returning false?");
+        return false;
     }
 
     gjs_debug(GJS_DEBUG_CONTEXT,
@@ -1338,5 +1338,5 @@ gjs_eval_with_scope(JSContext    *context,
     if (retval_p)
         *retval_p = retval;
 
-    return JS_TRUE;
+    return true;
 }
diff --git a/gjs/jsapi-util.h b/gjs/jsapi-util.h
index b8972b1..224dfd3 100644
--- a/gjs/jsapi-util.h
+++ b/gjs/jsapi-util.h
@@ -77,10 +77,10 @@ typedef struct GjsRootedArray GjsRootedArray;
  *                              do_base_typecheck and priv_from_js
  */
 #define GJS_DEFINE_PRIV_FROM_JS(type, klass)                          \
-    __attribute__((unused)) static inline JSBool                        \
+    __attribute__((unused)) static inline bool                          \
     do_base_typecheck(JSContext *context,                               \
                       JSObject  *object,                                \
-                      JSBool     throw_error)                           \
+                      bool       throw_error)                           \
     {                                                                   \
         return gjs_typecheck_instance(context, object, &klass, throw_error);  \
     }                                                                   \
@@ -94,15 +94,15 @@ typedef struct GjsRootedArray GjsRootedArray;
         JS_EndRequest(context);                                         \
         return priv;                                                    \
     }                                                                   \
-    __attribute__((unused)) static JSBool                               \
+    __attribute__((unused)) static bool                                 \
     priv_from_js_with_typecheck(JSContext *context,                     \
                                 JSObject  *object,                      \
                                 type      **out)                        \
     {                                                                   \
-        if (!do_base_typecheck(context, object, JS_FALSE))              \
-            return JS_FALSE;                                            \
+        if (!do_base_typecheck(context, object, false))                 \
+            return false;                                               \
         *out = priv_from_js(context, object);                           \
-        return JS_TRUE;                                                 \
+        return true;                                                    \
     }
 
 /**
@@ -140,13 +140,13 @@ _GJS_DEFINE_PROTO_FULL(tn, cn, NULL, gtype, flags)
 extern JSPropertySpec gjs_##cname##_proto_props[]; \
 extern JSFunctionSpec gjs_##cname##_proto_funcs[]; \
 static void gjs_##cname##_finalize(JSFreeOp *fop, JSObject *obj); \
-static JSBool gjs_##cname##_new_resolve(JSContext *context, \
-                                        JSObject  *obj, \
-                                        JS::Value  id, \
-                                        unsigned   flags, \
-                                        JSObject **objp) \
+static bool gjs_##cname##_new_resolve(JSContext *context, \
+                                      JSObject  *obj, \
+                                      JS::Value  id, \
+                                      unsigned   flags, \
+                                      JSObject **objp) \
 { \
-    return JS_TRUE; \
+    return true; \
 } \
 static struct JSClass gjs_##cname##_class = { \
     type_name, \
@@ -225,15 +225,15 @@ gjs_##name##_constructor(JSContext  *context,           \
  * GJS_NATIVE_CONSTRUCTOR_PRELUDE:
  * Call after the initial variable declaration.
  */
-#define GJS_NATIVE_CONSTRUCTOR_PRELUDE(name)                            \
-    {                                                                   \
-        if (!JS_IsConstructing(context, vp)) {                          \
-            gjs_throw_constructor_error(context);                       \
-            return JS_FALSE;                                            \
-        }                                                               \
+#define GJS_NATIVE_CONSTRUCTOR_PRELUDE(name)                                   \
+    {                                                                          \
+        if (!JS_IsConstructing(context, vp)) {                                 \
+            gjs_throw_constructor_error(context);                              \
+            return false;                                                      \
+        }                                                                      \
         object = JS_NewObjectForConstructor(context, &gjs_##name##_class, vp); \
-        if (object == NULL)                                             \
-            return JS_FALSE;                                            \
+        if (object == NULL)                                                    \
+            return false;                                                      \
     }
 
 /**
@@ -254,7 +254,7 @@ gjs_##name##_constructor(JSContext  *context,           \
     GJS_NATIVE_CONSTRUCTOR_DECLARE(name)                        \
     {                                                           \
         gjs_throw_abstract_constructor_error(context, vp);      \
-        return JS_FALSE;                                        \
+        return false;                                           \
     }
 
 gboolean    gjs_init_context_standard        (JSContext       *context,
@@ -279,7 +279,7 @@ JSObject   *gjs_new_object_for_constructor   (JSContext       *context,
                                               JS::Value       *vp)
 G_GNUC_DEPRECATED_FOR(JS_NewObjectForConstructor);
 
-JSBool      gjs_init_class_dynamic           (JSContext       *context,
+bool        gjs_init_class_dynamic           (JSContext       *context,
                                               JSObject        *in_object,
                                               JSObject        *parent_proto,
                                               const char      *ns_name,
@@ -297,10 +297,10 @@ void gjs_throw_constructor_error             (JSContext       *context);
 void gjs_throw_abstract_constructor_error    (JSContext       *context,
                                               JS::Value       *vp);
 
-JSBool gjs_typecheck_instance                 (JSContext  *context,
+bool        gjs_typecheck_instance            (JSContext  *context,
                                                JSObject   *obj,
                                                JSClass    *static_clasp,
-                                               JSBool      _throw);
+                                               bool        _throw);
 
 JSObject*   gjs_construct_object_dynamic     (JSContext       *context,
                                               JSObject        *proto,
@@ -327,11 +327,11 @@ void        gjs_throw_literal                (JSContext       *context,
 void        gjs_throw_g_error                (JSContext       *context,
                                               GError          *error);
 
-JSBool      gjs_log_exception                (JSContext       *context);
-JSBool      gjs_log_and_keep_exception       (JSContext       *context);
-JSBool      gjs_move_exception               (JSContext       *src_context,
+bool        gjs_log_exception                (JSContext       *context);
+bool        gjs_log_and_keep_exception       (JSContext       *context);
+bool        gjs_move_exception               (JSContext       *src_context,
                                               JSContext       *dest_context);
-JSBool      gjs_log_exception_full           (JSContext       *context,
+bool        gjs_log_exception_full           (JSContext       *context,
                                               JS::Value        exc,
                                               JSString        *message);
 
@@ -345,7 +345,7 @@ char*       gjs_value_debug_string           (JSContext       *context,
                                               JS::Value        value);
 void        gjs_explain_scope                (JSContext       *context,
                                               const char      *title);
-JSBool      gjs_call_function_value          (JSContext       *context,
+bool        gjs_call_function_value          (JSContext       *context,
                                               JSObject        *obj,
                                               JS::Value        fval,
                                               unsigned         argc,
@@ -355,19 +355,19 @@ void        gjs_error_reporter               (JSContext       *context,
                                               const char      *message,
                                               JSErrorReport   *report);
 JSObject*   gjs_get_global_object            (JSContext *cx);
-JSBool      gjs_get_prop_verbose_stub        (JSContext       *context,
+bool        gjs_get_prop_verbose_stub        (JSContext       *context,
                                               JSObject        *obj,
                                               JS::Value        id,
                                               JS::Value       *value_p);
-JSBool      gjs_set_prop_verbose_stub        (JSContext       *context,
+bool        gjs_set_prop_verbose_stub        (JSContext       *context,
                                               JSObject        *obj,
                                               JS::Value        id,
                                               JS::Value       *value_p);
-JSBool      gjs_add_prop_verbose_stub        (JSContext       *context,
+bool        gjs_add_prop_verbose_stub        (JSContext       *context,
                                               JSObject        *obj,
                                               JS::Value        id,
                                               JS::Value       *value_p);
-JSBool      gjs_delete_prop_verbose_stub     (JSContext       *context,
+bool        gjs_delete_prop_verbose_stub     (JSContext       *context,
                                               JSObject        *obj,
                                               JS::Value        id,
                                               JS::Value       *value_p);
@@ -375,22 +375,22 @@ JSBool      gjs_delete_prop_verbose_stub     (JSContext       *context,
 JSBool      gjs_string_to_utf8               (JSContext       *context,
                                               const JS::Value  string_val,
                                               char           **utf8_string_p);
-JSBool      gjs_string_from_utf8             (JSContext       *context,
+bool        gjs_string_from_utf8             (JSContext       *context,
                                               const char      *utf8_string,
                                               gssize           n_bytes,
                                               JS::Value       *value_p);
 JSBool      gjs_string_to_filename           (JSContext       *context,
                                               const JS::Value  string_val,
                                               char           **filename_string_p);
-JSBool      gjs_string_from_filename         (JSContext       *context,
+bool        gjs_string_from_filename         (JSContext       *context,
                                               const char      *filename_string,
                                               gssize           n_bytes,
                                               JS::Value       *value_p);
-JSBool      gjs_string_get_uint16_data       (JSContext       *context,
+bool        gjs_string_get_uint16_data       (JSContext       *context,
                                               JS::Value        value,
                                               guint16        **data_p,
                                               gsize           *len_p);
-JSBool      gjs_get_string_id                (JSContext       *context,
+bool        gjs_get_string_id                (JSContext       *context,
                                               jsid             id,
                                               char           **name_p);
 jsid        gjs_intern_string_to_id          (JSContext       *context,
@@ -402,18 +402,18 @@ gboolean    gjs_unichar_from_string          (JSContext       *context,
 
 const char* gjs_get_type_name                (JS::Value        value);
 
-JSBool      gjs_value_to_int64               (JSContext       *context,
+bool        gjs_value_to_int64               (JSContext       *context,
                                               const JS::Value  val,
                                               gint64          *result);
 
-JSBool      gjs_parse_args                   (JSContext  *context,
+bool        gjs_parse_args                   (JSContext  *context,
                                               const char *function_name,
                                               const char *format,
                                               unsigned   argc,
                                               JS::Value  *argv,
                                               ...);
 
-JSBool      gjs_parse_call_args              (JSContext    *context,
+bool        gjs_parse_call_args              (JSContext    *context,
                                               const char   *function_name,
                                               const char   *format,
                                               JS::CallArgs &args,
@@ -448,12 +448,12 @@ void              gjs_unroot_value_locations  (JSContext        *context,
 
 void gjs_maybe_gc (JSContext *context);
 
-JSBool            gjs_context_get_frame_info (JSContext  *context,
+bool              gjs_context_get_frame_info (JSContext  *context,
                                               JS::Value  *stack,
                                               JS::Value  *fileName,
                                               JS::Value  *lineNumber);
 
-JSBool            gjs_eval_with_scope        (JSContext    *context,
+bool              gjs_eval_with_scope        (JSContext    *context,
                                               JSObject     *object,
                                               const char   *script,
                                               gssize        script_len,
diff --git a/gjs/native.cpp b/gjs/native.cpp
index 65a528b..cb2eb6e 100644
--- a/gjs/native.cpp
+++ b/gjs/native.cpp
@@ -81,7 +81,7 @@ gjs_is_registered_native_module(JSContext  *context,
  *
  * Return a native module that's been preloaded.
  */
-JSBool
+bool
 gjs_import_native_module(JSContext   *context,
                          const char  *name,
                          JSObject   **module_out)
@@ -101,7 +101,7 @@ gjs_import_native_module(JSContext   *context,
         gjs_throw(context,
                   "No native module '%s' has registered itself",
                   name);
-        return JS_FALSE;
+        return false;
     }
 
     return func (context, module_out);
diff --git a/gjs/native.h b/gjs/native.h
index d2f4b4a..cfe5fd3 100644
--- a/gjs/native.h
+++ b/gjs/native.h
@@ -33,8 +33,8 @@
 
 G_BEGIN_DECLS
 
-typedef JSBool (* GjsDefineModuleFunc) (JSContext  *context,
-                                        JSObject  **module_out);
+typedef bool (* GjsDefineModuleFunc) (JSContext  *context,
+                                      JSObject  **module_out);
 
 /* called on context init */
 void   gjs_register_native_module (const char            *module_id,
@@ -46,9 +46,9 @@ gboolean gjs_is_registered_native_module(JSContext  *context,
                                          const char *name);
 
 /* called by importer.c to load a statically linked native module */
-JSBool gjs_import_native_module (JSContext  *context,
-                                 const char *name,
-                                 JSObject   **module_out);
+bool     gjs_import_native_module (JSContext  *context,
+                                   const char *name,
+                                   JSObject   **module_out);
 
 G_END_DECLS
 
diff --git a/gjs/runtime.cpp b/gjs/runtime.cpp
index 5c45004..5c8abdd 100644
--- a/gjs/runtime.cpp
+++ b/gjs/runtime.cpp
@@ -27,10 +27,10 @@
 #include "runtime.h"
 
 struct RuntimeData {
-  JSBool in_gc_sweep;
+  bool in_gc_sweep;
 };
 
-JSBool
+bool
 gjs_runtime_is_sweeping (JSRuntime *runtime)
 {
   RuntimeData *data = (RuntimeData*) JS_GetRuntimePrivate(runtime);
@@ -49,7 +49,7 @@ gjs_locale_to_upper_case (JSContext *context,
                           JS::HandleString src,
                           JS::MutableHandleValue retval)
 {
-    JSBool success = JS_FALSE;
+    bool success = false;
     char *utf8 = NULL;
     char *upper_case_utf8 = NULL;
 
@@ -61,7 +61,7 @@ gjs_locale_to_upper_case (JSContext *context,
     if (!gjs_string_from_utf8(context, upper_case_utf8, -1, retval.address()))
         goto out;
 
-    success = JS_TRUE;
+    success = true;
 
 out:
     g_free(utf8);
@@ -75,7 +75,7 @@ gjs_locale_to_lower_case (JSContext *context,
                           JS::HandleString src,
                           JS::MutableHandleValue retval)
 {
-    JSBool success = JS_FALSE;
+    bool success = false;
     char *utf8 = NULL;
     char *lower_case_utf8 = NULL;
 
@@ -87,7 +87,7 @@ gjs_locale_to_lower_case (JSContext *context,
     if (!gjs_string_from_utf8(context, lower_case_utf8, -1, retval.address()))
         goto out;
 
-    success = JS_TRUE;
+    success = true;
 
 out:
     g_free(utf8);
@@ -102,7 +102,7 @@ gjs_locale_compare (JSContext *context,
                     JS::HandleString src_2,
                     JS::MutableHandleValue retval)
 {
-    JSBool success = JS_FALSE;
+    bool success = false;
     char *utf8_1 = NULL, *utf8_2 = NULL;
 
     if (!gjs_string_to_utf8(context, JS::StringValue(src_1), &utf8_1) ||
@@ -111,7 +111,7 @@ gjs_locale_compare (JSContext *context,
 
     retval.setInt32(g_utf8_collate(utf8_1, utf8_2));
 
-    success = JS_TRUE;
+    success = true;
 
 out:
     g_free(utf8_1);
@@ -125,7 +125,7 @@ gjs_locale_to_unicode (JSContext  *context,
                        const char *src,
                        JS::MutableHandleValue retval)
 {
-    JSBool success;
+    bool success;
     char *utf8;
     GError *error = NULL;
 
@@ -135,7 +135,7 @@ gjs_locale_to_unicode (JSContext  *context,
                   "Failed to convert locale string to UTF8: %s",
                   error->message);
         g_error_free(error);
-        return JS_FALSE;
+        return false;
     }
 
     success = gjs_string_from_utf8(context, utf8, -1, retval.address());
@@ -216,9 +216,9 @@ gjs_finalize_callback(JSFreeOp         *fop,
   */
 
   if (status == JSFINALIZE_GROUP_START)
-    data->in_gc_sweep = JS_TRUE;
+    data->in_gc_sweep = true;
   else if (status == JSFINALIZE_GROUP_END)
-    data->in_gc_sweep = JS_FALSE;
+    data->in_gc_sweep = false;
 }
 
 JSRuntime *
diff --git a/gjs/runtime.h b/gjs/runtime.h
index 0474940..c2cb482 100644
--- a/gjs/runtime.h
+++ b/gjs/runtime.h
@@ -26,6 +26,6 @@
 
 JSRuntime * gjs_runtime_for_current_thread (void);
 
-JSBool      gjs_runtime_is_sweeping        (JSRuntime *runtime);
+bool        gjs_runtime_is_sweeping        (JSRuntime *runtime);
 
 #endif /* __GJS_RUNTIME_H__ */
diff --git a/gjs/stack.cpp b/gjs/stack.cpp
index ccc3a92..9f2b3f5 100644
--- a/gjs/stack.cpp
+++ b/gjs/stack.cpp
@@ -47,7 +47,7 @@
 #include "compat.h"
 #include "jsapi-util.h"
 
-JSBool
+bool
 gjs_context_get_frame_info (JSContext  *context,
                             JS::Value  *stack,
                             JS::Value  *fileName,
@@ -56,7 +56,7 @@ gjs_context_get_frame_info (JSContext  *context,
     JS::Value v_constructor;
     JSObject *err_obj;
     JSObject *global;
-    JSBool ret = JS_FALSE;
+    bool ret = false;
 
     JS_BeginRequest(context);
     global = JS_GetGlobalForScopeChain(context);
@@ -88,7 +88,7 @@ gjs_context_get_frame_info (JSContext  *context,
             goto out;
     }
 
-    ret = JS_TRUE;
+    ret = true;
 
  out:
     JS_EndRequest(context);
diff --git a/modules/cairo-context.cpp b/modules/cairo-context.cpp
index e3adfbd..9816127 100644
--- a/modules/cairo-context.cpp
+++ b/modules/cairo-context.cpp
@@ -31,7 +31,7 @@
 #include "cairo-private.h"
 
 #define _GJS_CAIRO_CONTEXT_DEFINE_FUNC_BEGIN(mname) \
-static JSBool                                       \
+static bool                                         \
 mname##_func(JSContext *context,                    \
               unsigned   argc,                      \
               JS::Value *vp)                        \
@@ -40,16 +40,14 @@ mname##_func(JSContext *context,                    \
     JSObject *obj = argv.thisv().toObjectOrNull();  \
     cairo_t *cr;
 
-#define _GJS_CAIRO_CONTEXT_DEFINE_FUNC_END                             \
-    if (!gjs_cairo_check_status(context, cairo_status(cr), "context")) \
-        return JS_FALSE;                                               \
-    return JS_TRUE;                                                    \
+#define _GJS_CAIRO_CONTEXT_DEFINE_FUNC_END                               \
+    return gjs_cairo_check_status(context, cairo_status(cr), "context"); \
 }
 
 #define _GJS_CAIRO_CONTEXT_CHECK_NO_ARGS(m)                        \
     if (argc > 0) {                                                \
         gjs_throw(context, "Context." #m "() takes no arguments"); \
-        return JS_FALSE;                                           \
+        return false;                                              \
     }
 
 #define _GJS_CAIRO_CONTEXT_DEFINE_FUNC0(method, cfunc)                     \
@@ -82,18 +80,18 @@ _GJS_CAIRO_CONTEXT_DEFINE_FUNC_BEGIN(method)                               \
     double arg1, arg2;                                                     \
     if (!gjs_parse_call_args(context, #method, "ff", argv,                 \
                         #n1, &arg1, #n2, &arg2))                           \
-        return JS_FALSE;                                                   \
+        return false;                                                      \
     cr = gjs_cairo_context_get_context(context, obj);                      \
     cfunc(cr, &arg1, &arg2);                                               \
     if (cairo_status(cr) == CAIRO_STATUS_SUCCESS) {                        \
       JSObject *array = JS_NewArrayObject(context, 0, NULL);               \
       if (!array)                                                          \
-        return JS_FALSE;                                                   \
+        return false;                                                      \
       JS::Value r;                                                         \
       r = JS::NumberValue(arg1);                                           \
-      if (!JS_SetElement(context, array, 0, &r)) return JS_FALSE;          \
+      if (!JS_SetElement(context, array, 0, &r)) return false;             \
       r = JS::NumberValue(arg2);                                           \
-      if (!JS_SetElement(context, array, 1, &r)) return JS_FALSE;          \
+      if (!JS_SetElement(context, array, 1, &r)) return false;             \
       argv.rval().setObject(*array);                                       \
     }                                                                      \
 _GJS_CAIRO_CONTEXT_DEFINE_FUNC_END
@@ -107,12 +105,12 @@ _GJS_CAIRO_CONTEXT_DEFINE_FUNC_BEGIN(method)                               \
     if (cairo_status(cr) == CAIRO_STATUS_SUCCESS) {                        \
       JSObject *array = JS_NewArrayObject(context, 0, NULL);               \
       if (!array)                                                          \
-        return JS_FALSE;                                                   \
+        return false;                                                      \
       JS::Value r;                                                         \
       r = JS::NumberValue(arg1);                                           \
-      if (!JS_SetElement(context, array, 0, &r)) return JS_FALSE;          \
+      if (!JS_SetElement(context, array, 0, &r)) return false;             \
       r = JS::NumberValue(arg2);                                           \
-      if (!JS_SetElement(context, array, 1, &r)) return JS_FALSE;          \
+      if (!JS_SetElement(context, array, 1, &r)) return false;             \
       argv.rval().setObject(*array);                                       \
     }                                                                      \
 _GJS_CAIRO_CONTEXT_DEFINE_FUNC_END
@@ -126,16 +124,16 @@ _GJS_CAIRO_CONTEXT_DEFINE_FUNC_BEGIN(method)                               \
     {                                                                      \
       JSObject *array = JS_NewArrayObject(context, 0, NULL);               \
       if (!array)                                                          \
-        return JS_FALSE;                                                   \
+        return false;                                                      \
       JS::Value r;                                                         \
       r = JS::NumberValue(arg1);                                           \
-      if (!JS_SetElement(context, array, 0, &r)) return JS_FALSE;          \
+      if (!JS_SetElement(context, array, 0, &r)) return false;             \
       r = JS::NumberValue(arg2);                                           \
-      if (!JS_SetElement(context, array, 1, &r)) return JS_FALSE;          \
+      if (!JS_SetElement(context, array, 1, &r)) return false;             \
       r = JS::NumberValue(arg3);                                           \
-      if (!JS_SetElement(context, array, 2, &r)) return JS_FALSE;          \
+      if (!JS_SetElement(context, array, 2, &r)) return false;             \
       r = JS::NumberValue(arg4);                                           \
-      if (!JS_SetElement(context, array, 3, &r)) return JS_FALSE;          \
+      if (!JS_SetElement(context, array, 3, &r)) return false;             \
       argv.rval().setObject(*array);                                       \
     }                                                                      \
 _GJS_CAIRO_CONTEXT_DEFINE_FUNC_END
@@ -154,7 +152,7 @@ _GJS_CAIRO_CONTEXT_DEFINE_FUNC_BEGIN(method)                               \
     t1 arg1;                                                               \
     if (!gjs_parse_call_args(context, #method, fmt, argv,                  \
                         #n1, &arg1))                                       \
-        return JS_FALSE;                                                   \
+        return false;                                                      \
     cr = gjs_cairo_context_get_context(context, obj);                      \
     cfunc(cr, arg1);                                                       \
     argv.rval().setUndefined();                                            \
@@ -166,7 +164,7 @@ _GJS_CAIRO_CONTEXT_DEFINE_FUNC_BEGIN(method)                               \
     t2 arg2;                                                               \
     if (!gjs_parse_call_args(context, #method, fmt, argv,                  \
                         #n1, &arg1, #n2, &arg2))                           \
-        return JS_FALSE;                                                   \
+        return false;                                                      \
     cr = gjs_cairo_context_get_context(context, obj);                      \
     cfunc(cr, arg1, arg2);                                                 \
     argv.rval().setUndefined();                                            \
@@ -179,7 +177,7 @@ _GJS_CAIRO_CONTEXT_DEFINE_FUNC_BEGIN(method)                               \
     cairo_bool_t ret;                                                      \
     if (!gjs_parse_call_args(context, #method, fmt, argv,                 \
                         #n1, &arg1, #n2, &arg2))                           \
-        return JS_FALSE;                                                   \
+        return false;                                                      \
     cr = gjs_cairo_context_get_context(context, obj);                      \
     ret = cfunc(cr, arg1, arg2);                                           \
     argv.rval().setBoolean(ret);                                           \
@@ -192,7 +190,7 @@ _GJS_CAIRO_CONTEXT_DEFINE_FUNC_BEGIN(method)                               \
     t3 arg3;                                                               \
     if (!gjs_parse_call_args(context, #method, fmt, argv,                  \
                         #n1, &arg1, #n2, &arg2, #n3, &arg3))               \
-        return JS_FALSE;                                                   \
+        return false;                                                      \
     cr = gjs_cairo_context_get_context(context, obj);                      \
     cfunc(cr, arg1, arg2, arg3);                                           \
     argv.rval().setUndefined();                                            \
@@ -206,7 +204,7 @@ _GJS_CAIRO_CONTEXT_DEFINE_FUNC_BEGIN(method)                               \
     t4 arg4;                                                               \
     if (!gjs_parse_call_args(context, #method, fmt, argv,                  \
                         #n1, &arg1, #n2, &arg2, #n3, &arg3, #n4, &arg4))   \
-        return JS_FALSE;                                                   \
+        return false;                                                      \
     cr = gjs_cairo_context_get_context(context, obj);                      \
     cfunc(cr, arg1, arg2, arg3, arg4);                                     \
 _GJS_CAIRO_CONTEXT_DEFINE_FUNC_END
@@ -221,7 +219,7 @@ _GJS_CAIRO_CONTEXT_DEFINE_FUNC_BEGIN(method)                               \
     if (!gjs_parse_call_args(context, #method, fmt, argv,                  \
                         #n1, &arg1, #n2, &arg2, #n3, &arg3,                \
                         #n4, &arg4, #n5, &arg5))                           \
-        return JS_FALSE;                                                   \
+        return false;                                                      \
     cr = gjs_cairo_context_get_context(context, obj);                      \
     cfunc(cr, arg1, arg2, arg3, arg4, arg5);                               \
     argv.rval().setUndefined();                                            \
@@ -238,7 +236,7 @@ _GJS_CAIRO_CONTEXT_DEFINE_FUNC_BEGIN(method)                               \
     if (!gjs_parse_call_args(context, #method, fmt, argv,                  \
                         #n1, &arg1, #n2, &arg2, #n3, &arg3,                \
                         #n4, &arg4, #n5, &arg5, #n6, &arg6))               \
-        return JS_FALSE;                                                   \
+        return false;                                                      \
     cr = gjs_cairo_context_get_context(context, obj);                      \
     cfunc(cr, arg1, arg2, arg3, arg4, arg5, arg6);                         \
     argv.rval().setUndefined();                                            \
@@ -282,25 +280,25 @@ GJS_NATIVE_CONSTRUCTOR_DECLARE(cairo_context)
 
     if (!gjs_parse_call_args(context, "Context", "o", argv,
                         "surface", &surface_wrapper))
-        return JS_FALSE;
+        return false;
 
     surface = gjs_cairo_surface_get_surface(context, surface_wrapper);
     if (!surface) {
         gjs_throw(context, "first argument to Context() should be a surface");
-        return JS_FALSE;
+        return false;
     }
 
     cr = cairo_create(surface);
 
     if (!gjs_cairo_check_status(context, cairo_status(cr), "context"))
-        return JS_FALSE;
+        return false;
 
     _gjs_cairo_context_construct_internal(context, object, cr);
     cairo_destroy(cr);
 
     GJS_NATIVE_CONSTRUCTOR_FINISH(cairo_context);
 
-    return JS_TRUE;
+    return true;
 }
 
 static void
@@ -403,7 +401,7 @@ _GJS_CAIRO_CONTEXT_DEFINE_FUNC2FFAFF(userToDevice, cairo_user_to_device, "x", "y
 _GJS_CAIRO_CONTEXT_DEFINE_FUNC2FFAFF(userToDeviceDistance, cairo_user_to_device_distance, "x", "y")
 
 
-static JSBool
+static bool
 dispose_func(JSContext *context,
              unsigned   argc,
              JS::Value *vp)
@@ -419,10 +417,10 @@ dispose_func(JSContext *context,
         priv->cr = NULL;
     }
     rec.rval().setUndefined();
-    return JS_TRUE;
+    return true;
 }
 
-static JSBool
+static bool
 appendPath_func(JSContext *context,
                 unsigned   argc,
                 JS::Value *vp)
@@ -436,21 +434,21 @@ appendPath_func(JSContext *context,
 
     if (!gjs_parse_call_args(context, "path", "o", argv,
                         "path", &path_wrapper))
-        return JS_FALSE;
+        return false;
 
     path = gjs_cairo_path_get_path(context, path_wrapper);
     if (!path) {
         gjs_throw(context, "first argument to appendPath() should be a path");
-        return JS_FALSE;
+        return false;
     }
 
     cr = gjs_cairo_context_get_context(context, obj);
     cairo_append_path(cr, path);
     argv.rval().setUndefined();
-    return JS_TRUE;
+    return true;
 }
 
-static JSBool
+static bool
 copyPath_func(JSContext *context,
               unsigned   argc,
               JS::Value *vp)
@@ -462,15 +460,15 @@ copyPath_func(JSContext *context,
     cairo_t *cr;
 
     if (!gjs_parse_call_args(context, "", "", argv))
-        return JS_FALSE;
+        return false;
 
     cr = gjs_cairo_context_get_context(context, obj);
     path = cairo_copy_path(cr);
     argv.rval().setObjectOrNull(gjs_cairo_path_from_path(context, path));
-    return JS_TRUE;
+    return true;
 }
 
-static JSBool
+static bool
 copyPathFlat_func(JSContext *context,
                   unsigned   argc,
                   JS::Value *vp)
@@ -482,15 +480,15 @@ copyPathFlat_func(JSContext *context,
     cairo_t *cr;
 
     if (!gjs_parse_call_args(context, "", "", argv))
-        return JS_FALSE;
+        return false;
 
     cr = gjs_cairo_context_get_context(context, obj);
     path = cairo_copy_path_flat(cr);
     argv.rval().setObjectOrNull(gjs_cairo_path_from_path(context, path));
-    return JS_TRUE;
+    return true;
 }
 
-static JSBool
+static bool
 mask_func(JSContext *context,
           unsigned   argc,
           JS::Value *vp)
@@ -504,25 +502,25 @@ mask_func(JSContext *context,
 
     if (!gjs_parse_call_args(context, "mask", "o", argv,
                         "pattern", &pattern_wrapper))
-        return JS_FALSE;
+        return false;
 
     pattern = gjs_cairo_pattern_get_pattern(context, pattern_wrapper);
     if (!pattern) {
         gjs_throw(context, "first argument to mask() should be a pattern");
-        return JS_FALSE;
+        return false;
     }
 
     cr = gjs_cairo_context_get_context(context, obj);
     cairo_mask(cr, pattern);
 
     if (!gjs_cairo_check_status(context, cairo_status(cr), "context"))
-        return JS_FALSE;
+        return false;
 
     argv.rval().setUndefined();
-    return JS_TRUE;
+    return true;
 }
 
-static JSBool
+static bool
 maskSurface_func(JSContext *context,
                  unsigned   argc,
                  JS::Value *vp)
@@ -539,12 +537,12 @@ maskSurface_func(JSContext *context,
                         "surface", &surface_wrapper,
                         "x", &x,
                         "y", &y))
-        return JS_FALSE;
+        return false;
 
     surface = gjs_cairo_surface_get_surface(context, surface_wrapper);
     if (!surface) {
         gjs_throw(context, "first argument to maskSurface() should be a surface");
-        return JS_FALSE;
+        return false;
     }
 
     cr = gjs_cairo_context_get_context(context, obj);
@@ -552,13 +550,13 @@ maskSurface_func(JSContext *context,
     cairo_mask_surface(cr, surface, x, y);
 
     if (!gjs_cairo_check_status(context, cairo_status(cr), "context"))
-        return JS_FALSE;
+        return false;
 
     argv.rval().setUndefined();
-    return JS_TRUE;
+    return true;
 }
 
-static JSBool
+static bool
 setDash_func(JSContext *context,
              unsigned   argc,
              JS::Value *vp)
@@ -570,13 +568,13 @@ setDash_func(JSContext *context,
     cairo_t *cr;
     JSObject *dashes;
     double offset;
-    JSBool retval = JS_FALSE;
+    bool retval = false;
     guint len;
     GArray *dashes_c = NULL;
 
     if (!gjs_parse_call_args(context, "setDash", "of", argv,
                         "dashes", &dashes, "offset", &offset))
-        return JS_FALSE;
+        return false;
 
     JS_AddObjectRoot(context, &dashes);
 
@@ -615,7 +613,7 @@ setDash_func(JSContext *context,
     cr = gjs_cairo_context_get_context(context, obj);
     cairo_set_dash(cr, (double*)dashes_c->data, dashes_c->len, offset);
     argv.rval().setUndefined();
-    retval = JS_TRUE;
+    retval = true;
  out:
     if (dashes_c != NULL)
         g_array_free (dashes_c, TRUE);
@@ -623,7 +621,7 @@ setDash_func(JSContext *context,
     return retval;
 }
 
-static JSBool
+static bool
 setSource_func(JSContext *context,
                unsigned   argc,
                JS::Value *vp)
@@ -637,12 +635,12 @@ setSource_func(JSContext *context,
 
     if (!gjs_parse_call_args(context, "setSource", "o", argv,
                         "pattern", &pattern_wrapper))
-        return JS_FALSE;
+        return false;
 
     pattern = gjs_cairo_pattern_get_pattern(context, pattern_wrapper);
     if (!pattern) {
         gjs_throw(context, "first argument to setSource() should be a pattern");
-        return JS_FALSE;
+        return false;
     }
 
     cr = gjs_cairo_context_get_context(context, obj);
@@ -650,14 +648,14 @@ setSource_func(JSContext *context,
     cairo_set_source(cr, pattern);
 
     if (!gjs_cairo_check_status(context, cairo_status(cr), "context"))
-        return JS_FALSE;
+        return false;
 
     argv.rval().setUndefined();
 
-    return JS_TRUE;
+    return true;
 }
 
-static JSBool
+static bool
 setSourceSurface_func(JSContext *context,
                       unsigned   argc,
                       JS::Value *vp)
@@ -674,12 +672,12 @@ setSourceSurface_func(JSContext *context,
                         "surface", &surface_wrapper,
                         "x", &x,
                         "y", &y))
-        return JS_FALSE;
+        return false;
 
     surface = gjs_cairo_surface_get_surface(context, surface_wrapper);
     if (!surface) {
         gjs_throw(context, "first argument to setSourceSurface() should be a surface");
-        return JS_FALSE;
+        return false;
     }
 
     cr = gjs_cairo_context_get_context(context, obj);
@@ -687,14 +685,14 @@ setSourceSurface_func(JSContext *context,
     cairo_set_source_surface(cr, surface, x, y);
 
     if (!gjs_cairo_check_status(context, cairo_status(cr), "context"))
-        return JS_FALSE;
+        return false;
 
     argv.rval().setUndefined();
 
-    return JS_TRUE;
+    return true;
 }
 
-static JSBool
+static bool
 showText_func(JSContext *context,
               unsigned   argc,
               JS::Value *vp)
@@ -707,7 +705,7 @@ showText_func(JSContext *context,
 
     if (!gjs_parse_call_args(context, "showText", "s", argv,
                         "utf8", &utf8))
-        return JS_FALSE;
+        return false;
 
     cr = gjs_cairo_context_get_context(context, obj);
 
@@ -715,14 +713,14 @@ showText_func(JSContext *context,
     g_free(utf8);
 
     if (!gjs_cairo_check_status(context, cairo_status(cr), "context"))
-        return JS_FALSE;
+        return false;
 
     argv.rval().setUndefined();
 
-    return JS_TRUE;
+    return true;
 }
 
-static JSBool
+static bool
 selectFontFace_func(JSContext *context,
                     unsigned   argc,
                     JS::Value *vp)
@@ -739,7 +737,7 @@ selectFontFace_func(JSContext *context,
                         "family", &family,
                         "slang", &slant,
                         "weight", &weight))
-        return JS_FALSE;
+        return false;
 
     cr = gjs_cairo_context_get_context(context, obj);
 
@@ -747,13 +745,13 @@ selectFontFace_func(JSContext *context,
     g_free(family);
 
     if (!gjs_cairo_check_status(context, cairo_status(cr), "context"))
-        return JS_FALSE;
+        return false;
     argv.rval().setUndefined();
 
-    return JS_TRUE;
+    return true;
 }
 
-static JSBool
+static bool
 popGroup_func(JSContext *context,
               unsigned   argc,
               JS::Value *vp)
@@ -767,26 +765,26 @@ popGroup_func(JSContext *context,
 
     if (argc > 0) {
         gjs_throw(context, "Context.popGroup() takes no arguments");
-        return JS_FALSE;
+        return false;
     }
 
     cr = gjs_cairo_context_get_context(context, obj);
     pattern = cairo_pop_group(cr);
     if (!gjs_cairo_check_status(context, cairo_status(cr), "context"))
-        return JS_FALSE;
+        return false;
 
     /* pattern belongs to the context, so keep the reference */
     pattern_wrapper = gjs_cairo_pattern_from_pattern(context, pattern);
     if (!pattern_wrapper) {
         gjs_throw(context, "failed to create pattern");
-        return JS_FALSE;
+        return false;
     }
 
     rec.rval().setObject(*pattern_wrapper);
 
-    return JS_TRUE;
+    return true;
 }
-static JSBool
+static bool
 getSource_func(JSContext *context,
                unsigned   argc,
                JS::Value *vp)
@@ -800,27 +798,27 @@ getSource_func(JSContext *context,
 
     if (argc > 0) {
         gjs_throw(context, "Context.getSource() takes no arguments");
-        return JS_FALSE;
+        return false;
     }
 
     cr = gjs_cairo_context_get_context(context, obj);
     pattern = cairo_get_source(cr);
     if (!gjs_cairo_check_status(context, cairo_status(cr), "context"))
-        return JS_FALSE;
+        return false;
 
     /* pattern belongs to the context, so keep the reference */
     pattern_wrapper = gjs_cairo_pattern_from_pattern(context, pattern);
     if (!pattern_wrapper) {
         gjs_throw(context, "failed to create pattern");
-        return JS_FALSE;
+        return false;
     }
 
     rec.rval().setObject(*pattern_wrapper);
 
-    return JS_TRUE;
+    return true;
 }
 
-static JSBool
+static bool
 getTarget_func(JSContext *context,
                unsigned   argc,
                JS::Value *vp)
@@ -834,27 +832,27 @@ getTarget_func(JSContext *context,
 
     if (argc > 0) {
         gjs_throw(context, "Context.getTarget() takes no arguments");
-        return JS_FALSE;
+        return false;
     }
 
     cr = gjs_cairo_context_get_context(context, obj);
     surface = cairo_get_target(cr);
     if (!gjs_cairo_check_status(context, cairo_status(cr), "context"))
-        return JS_FALSE;
+        return false;
 
     /* surface belongs to the context, so keep the reference */
     surface_wrapper = gjs_cairo_surface_from_surface(context, surface);
     if (!surface_wrapper) {
         /* exception already set */
-        return JS_FALSE;
+        return false;
     }
 
     rec.rval().setObject(*surface_wrapper);
 
-    return JS_TRUE;
+    return true;
 }
 
-static JSBool
+static bool
 getGroupTarget_func(JSContext *context,
                     unsigned   argc,
                     JS::Value *vp)
@@ -868,24 +866,24 @@ getGroupTarget_func(JSContext *context,
 
     if (argc > 0) {
         gjs_throw(context, "Context.getGroupTarget() takes no arguments");
-        return JS_FALSE;
+        return false;
     }
 
     cr = gjs_cairo_context_get_context(context, obj);
     surface = cairo_get_group_target(cr);
     if (!gjs_cairo_check_status(context, cairo_status(cr), "context"))
-        return JS_FALSE;
+        return false;
 
     /* surface belongs to the context, so keep the reference */
     surface_wrapper = gjs_cairo_surface_from_surface(context, surface);
     if (!surface_wrapper) {
         /* exception already set */
-        return JS_FALSE;
+        return false;
     }
 
     rec.rval().setObject(*surface_wrapper);
 
-    return JS_TRUE;
+    return true;
 }
 
 JSFunctionSpec gjs_cairo_context_proto_funcs[] = {
@@ -1017,7 +1015,7 @@ gjs_cairo_context_get_context(JSContext *context,
     return priv->cr;
 }
 
-static JSBool
+static bool
 context_to_g_argument(JSContext      *context,
                       JS::Value       value,
                       const char     *arg_name,
@@ -1032,15 +1030,15 @@ context_to_g_argument(JSContext      *context,
     obj = value.toObjectOrNull();
     cr = gjs_cairo_context_get_context(context, obj);
     if (!cr)
-        return JS_FALSE;
+        return false;
     if (transfer == GI_TRANSFER_EVERYTHING)
         cairo_reference(cr);
 
     arg->v_pointer = cr;
-    return JS_TRUE;
+    return true;
 }
 
-static JSBool
+static bool
 context_from_g_argument(JSContext  *context,
                         JS::Value  *value_p,
                         GArgument  *arg)
@@ -1049,19 +1047,19 @@ context_from_g_argument(JSContext  *context,
 
     obj = gjs_cairo_context_from_context(context, (cairo_t*)arg->v_pointer);
     if (!obj)
-        return JS_FALSE;
+        return false;
 
     *value_p = JS::ObjectValue(*obj);
-    return JS_TRUE;
+    return true;
 }
 
-static JSBool
+static bool
 context_release_argument(JSContext  *context,
                          GITransfer  transfer,
                          GArgument  *arg)
 {
     cairo_destroy((cairo_t*)arg->v_pointer);
-    return JS_TRUE;
+    return true;
 }
 
 static GjsForeignInfo foreign_info = {
diff --git a/modules/cairo-gradient.cpp b/modules/cairo-gradient.cpp
index 7f91b96..a4e81c6 100644
--- a/modules/cairo-gradient.cpp
+++ b/modules/cairo-gradient.cpp
@@ -43,7 +43,7 @@ JSPropertySpec gjs_cairo_gradient_proto_props[] = {
 
 /* Methods */
 
-static JSBool
+static bool
 addColorStopRGB_func(JSContext *context,
                      unsigned   argc,
                      JS::Value *vp)
@@ -59,20 +59,20 @@ addColorStopRGB_func(JSContext *context,
                         "red", &red,
                         "green", &green,
                         "blue", &blue))
-        return JS_FALSE;
+        return false;
 
     pattern = gjs_cairo_pattern_get_pattern(context, obj);
 
     cairo_pattern_add_color_stop_rgb(pattern, offset, red, green, blue);
 
     if (!gjs_cairo_check_status(context, cairo_pattern_status(pattern), "pattern"))
-        return JS_FALSE;
+        return false;
 
     argv.rval().setUndefined();
-    return JS_TRUE;
+    return true;
 }
 
-static JSBool
+static bool
 addColorStopRGBA_func(JSContext *context,
                       unsigned   argc,
                       JS::Value *vp)
@@ -89,16 +89,16 @@ addColorStopRGBA_func(JSContext *context,
                         "green", &green,
                         "blue", &blue,
                         "alpha", &alpha))
-        return JS_FALSE;
+        return false;
 
     pattern = gjs_cairo_pattern_get_pattern(context, obj);
     cairo_pattern_add_color_stop_rgba(pattern, offset, red, green, blue, alpha);
 
     if (!gjs_cairo_check_status(context, cairo_pattern_status(pattern), "pattern"))
-        return JS_FALSE;
+        return false;
 
     argv.rval().setUndefined();
-    return JS_TRUE;
+    return true;
 }
 
 JSFunctionSpec gjs_cairo_gradient_proto_funcs[] = {
diff --git a/modules/cairo-image-surface.cpp b/modules/cairo-image-surface.cpp
index ef996ea..f3e08dc 100644
--- a/modules/cairo-image-surface.cpp
+++ b/modules/cairo-image-surface.cpp
@@ -42,19 +42,19 @@ GJS_NATIVE_CONSTRUCTOR_DECLARE(cairo_image_surface)
                         "format", &format,
                         "width", &width,
                         "height", &height))
-        return JS_FALSE;
+        return false;
 
     surface = cairo_image_surface_create((cairo_format_t) format, width, height);
 
     if (!gjs_cairo_check_status(context, cairo_surface_status(surface), "surface"))
-        return JS_FALSE;
+        return false;
 
     gjs_cairo_surface_construct(context, object, surface);
     cairo_surface_destroy(surface);
 
     GJS_NATIVE_CONSTRUCTOR_FINISH(cairo_image_surface);
 
-    return JS_TRUE;
+    return true;
 }
 
 static void
@@ -68,7 +68,7 @@ JSPropertySpec gjs_cairo_image_surface_proto_props[] = {
     { NULL }
 };
 
-static JSBool
+static bool
 createFromPNG_func(JSContext *context,
                    unsigned   argc,
                    JS::Value *vp)
@@ -80,26 +80,26 @@ createFromPNG_func(JSContext *context,
 
     if (!gjs_parse_call_args(context, "createFromPNG", "s", argv,
                         "filename", &filename))
-        return JS_FALSE;
+        return false;
 
     surface = cairo_image_surface_create_from_png(filename);
 
     if (!gjs_cairo_check_status(context, cairo_surface_status(surface), "surface"))
-        return JS_FALSE;
+        return false;
 
     surface_wrapper = JS_NewObject(context, &gjs_cairo_image_surface_class, NULL, NULL);
     if (!surface_wrapper) {
         gjs_throw(context, "failed to create surface");
-        return JS_FALSE;
+        return false;
     }
     gjs_cairo_surface_construct(context, surface_wrapper, surface);
     cairo_surface_destroy(surface);
 
     argv.rval().setObject(*surface_wrapper);
-    return JS_TRUE;
+    return true;
 }
 
-static JSBool
+static bool
 getFormat_func(JSContext *context,
                unsigned   argc,
                JS::Value *vp)
@@ -112,20 +112,20 @@ getFormat_func(JSContext *context,
 
     if (argc > 1) {
         gjs_throw(context, "ImageSurface.getFormat() takes no arguments");
-        return JS_FALSE;
+        return false;
     }
 
     surface = gjs_cairo_surface_get_surface(context, obj);
     format = cairo_image_surface_get_format(surface);
 
     if (!gjs_cairo_check_status(context, cairo_surface_status(surface), "surface"))
-        return JS_FALSE;
+        return false;
 
     rec.rval().setInt32(format);
-    return JS_TRUE;
+    return true;
 }
 
-static JSBool
+static bool
 getWidth_func(JSContext *context,
               unsigned   argc,
               JS::Value *vp)
@@ -138,20 +138,20 @@ getWidth_func(JSContext *context,
 
     if (argc > 1) {
         gjs_throw(context, "ImageSurface.getWidth() takes no arguments");
-        return JS_FALSE;
+        return false;
     }
 
     surface = gjs_cairo_surface_get_surface(context, obj);
     width = cairo_image_surface_get_width(surface);
 
     if (!gjs_cairo_check_status(context, cairo_surface_status(surface), "surface"))
-        return JS_FALSE;
+        return false;
 
     rec.rval().setInt32(width);
-    return JS_TRUE;
+    return true;
 }
 
-static JSBool
+static bool
 getHeight_func(JSContext *context,
                unsigned   argc,
                JS::Value *vp)
@@ -164,20 +164,20 @@ getHeight_func(JSContext *context,
 
     if (argc > 1) {
         gjs_throw(context, "ImageSurface.getHeight() takes no arguments");
-        return JS_FALSE;
+        return false;
     }
 
     surface = gjs_cairo_surface_get_surface(context, obj);
     height = cairo_image_surface_get_height(surface);
 
     if (!gjs_cairo_check_status(context, cairo_surface_status(surface), "surface"))
-        return JS_FALSE;
+        return false;
 
     rec.rval().setInt32(height);
-    return JS_TRUE;
+    return true;
 }
 
-static JSBool
+static bool
 getStride_func(JSContext *context,
                unsigned   argc,
                JS::Value *vp)
@@ -190,17 +190,17 @@ getStride_func(JSContext *context,
 
     if (argc > 1) {
         gjs_throw(context, "ImageSurface.getStride() takes no arguments");
-        return JS_FALSE;
+        return false;
     }
 
     surface = gjs_cairo_surface_get_surface(context, obj);
     stride = cairo_image_surface_get_stride(surface);
 
     if (!gjs_cairo_check_status(context, cairo_surface_status(surface), "surface"))
-        return JS_FALSE;
+        return false;
 
     rec.rval().setInt32(stride);
-    return JS_TRUE;
+    return true;
 }
 
 JSFunctionSpec gjs_cairo_image_surface_proto_funcs[] = {
diff --git a/modules/cairo-linear-gradient.cpp b/modules/cairo-linear-gradient.cpp
index 89c70a6..27e346d 100644
--- a/modules/cairo-linear-gradient.cpp
+++ b/modules/cairo-linear-gradient.cpp
@@ -42,19 +42,19 @@ GJS_NATIVE_CONSTRUCTOR_DECLARE(cairo_linear_gradient)
                         "y0", &y0,
                         "x1", &x1,
                         "y1", &y1))
-        return JS_FALSE;
+        return false;
 
     pattern = cairo_pattern_create_linear(x0, y0, x1, y1);
 
     if (!gjs_cairo_check_status(context, cairo_pattern_status(pattern), "pattern"))
-        return JS_FALSE;
+        return false;
 
     gjs_cairo_pattern_construct(context, object, pattern);
     cairo_pattern_destroy(pattern);
 
     GJS_NATIVE_CONSTRUCTOR_FINISH(cairo_linear_gradient);
 
-    return JS_TRUE;
+    return true;
 }
 
 static void
diff --git a/modules/cairo-module.h b/modules/cairo-module.h
index 9b5e2d5..f2613af 100644
--- a/modules/cairo-module.h
+++ b/modules/cairo-module.h
@@ -23,7 +23,7 @@
 #ifndef __CAIRO_MODULE_H__
 #define __CAIRO_MODULE_H__
 
-JSBool           gjs_js_define_cairo_stuff              (JSContext       *context,
-                                                         JSObject       **module_out);
+bool  gjs_js_define_cairo_stuff (JSContext  *context,
+                                 JSObject  **module_out);
 
 #endif /* __CAIRO_MODULE_H__ */
diff --git a/modules/cairo-pattern.cpp b/modules/cairo-pattern.cpp
index 9065781..186b347 100644
--- a/modules/cairo-pattern.cpp
+++ b/modules/cairo-pattern.cpp
@@ -57,7 +57,7 @@ JSPropertySpec gjs_cairo_pattern_proto_props[] = {
 
 /* Methods */
 
-static JSBool
+static bool
 getType_func(JSContext *context,
              unsigned   argc,
              JS::Value *vp)
@@ -70,17 +70,17 @@ getType_func(JSContext *context,
 
     if (argc > 1) {
         gjs_throw(context, "Pattern.getType() takes no arguments");
-        return JS_FALSE;
+        return false;
     }
 
     pattern = gjs_cairo_pattern_get_pattern(context, obj);
     type = cairo_pattern_get_type(pattern);
 
     if (!gjs_cairo_check_status(context, cairo_pattern_status(pattern), "pattern"))
-        return JS_FALSE;
+        return false;
 
     rec.rval().setInt32(type);
-    return JS_TRUE;
+    return true;
 }
 
 JSFunctionSpec gjs_cairo_pattern_proto_funcs[] = {
diff --git a/modules/cairo-pdf-surface.cpp b/modules/cairo-pdf-surface.cpp
index 22644c4..f971a3b 100644
--- a/modules/cairo-pdf-surface.cpp
+++ b/modules/cairo-pdf-surface.cpp
@@ -45,14 +45,14 @@ GJS_NATIVE_CONSTRUCTOR_DECLARE(cairo_pdf_surface)
                         "filename", &filename,
                         "width", &width,
                         "height", &height))
-        return JS_FALSE;
+        return false;
 
     surface = cairo_pdf_surface_create(filename, width, height);
 
     if (!gjs_cairo_check_status(context, cairo_surface_status(surface),
                                 "surface")) {
         g_free(filename);
-        return JS_FALSE;
+        return false;
     }
 
     gjs_cairo_surface_construct(context, object, surface);
@@ -61,7 +61,7 @@ GJS_NATIVE_CONSTRUCTOR_DECLARE(cairo_pdf_surface)
 
     GJS_NATIVE_CONSTRUCTOR_FINISH(cairo_pdf_surface);
 
-    return JS_TRUE;
+    return true;
 }
 
 static void
diff --git a/modules/cairo-private.h b/modules/cairo-private.h
index 8416b11..3879f4c 100644
--- a/modules/cairo-private.h
+++ b/modules/cairo-private.h
@@ -26,7 +26,7 @@
 #include "cairo-module.h"
 #include <cairo.h>
 
-JSBool           gjs_cairo_check_status                 (JSContext       *context,
+bool             gjs_cairo_check_status                 (JSContext       *context,
                                                          cairo_status_t   status,
                                                          const char      *name);
 
diff --git a/modules/cairo-ps-surface.cpp b/modules/cairo-ps-surface.cpp
index 3a963ad..b33b85e 100644
--- a/modules/cairo-ps-surface.cpp
+++ b/modules/cairo-ps-surface.cpp
@@ -45,14 +45,14 @@ GJS_NATIVE_CONSTRUCTOR_DECLARE(cairo_ps_surface)
                         "filename", &filename,
                         "width", &width,
                         "height", &height))
-        return JS_FALSE;
+        return false;
 
     surface = cairo_ps_surface_create(filename, width, height);
 
     if (!gjs_cairo_check_status(context, cairo_surface_status(surface),
                                 "surface")) {
         g_free(filename);
-        return JS_FALSE;
+        return false;
     }
 
     gjs_cairo_surface_construct(context, object, surface);
@@ -61,7 +61,7 @@ GJS_NATIVE_CONSTRUCTOR_DECLARE(cairo_ps_surface)
 
     GJS_NATIVE_CONSTRUCTOR_FINISH(cairo_ps_surface);
 
-    return JS_TRUE;
+    return true;
 }
 
 static void
diff --git a/modules/cairo-radial-gradient.cpp b/modules/cairo-radial-gradient.cpp
index 57ab3f5..f5c21ec 100644
--- a/modules/cairo-radial-gradient.cpp
+++ b/modules/cairo-radial-gradient.cpp
@@ -44,19 +44,19 @@ GJS_NATIVE_CONSTRUCTOR_DECLARE(cairo_radial_gradient)
                         "cx1", &cx1,
                         "cy1", &cy1,
                         "radius1", &radius1))
-        return JS_FALSE;
+        return false;
 
     pattern = cairo_pattern_create_radial(cx0, cy0, radius0, cx1, cy1, radius1);
 
     if (!gjs_cairo_check_status(context, cairo_pattern_status(pattern), "pattern"))
-        return JS_FALSE;
+        return false;
 
     gjs_cairo_pattern_construct(context, object, pattern);
     cairo_pattern_destroy(pattern);
 
     GJS_NATIVE_CONSTRUCTOR_FINISH(cairo_radial_gradient);
 
-    return JS_TRUE;
+    return true;
 }
 
 static void
diff --git a/modules/cairo-region.cpp b/modules/cairo-region.cpp
index 244a269..51a2f7b 100644
--- a/modules/cairo-region.cpp
+++ b/modules/cairo-region.cpp
@@ -49,7 +49,7 @@ get_region(JSContext *context,
         return priv->region;
 }
 
-static JSBool
+static bool
 fill_rectangle(JSContext *context, JSObject *obj,
                cairo_rectangle_int_t *rect);
 
@@ -62,7 +62,7 @@ fill_rectangle(JSContext *context, JSObject *obj,
     return gjs_cairo_check_status(context, cairo_region_status(this_region), "region");
 
 #define REGION_DEFINE_REGION_FUNC(method)                       \
-    static JSBool                                               \
+    static bool                                                 \
     method##_func(JSContext *context,                           \
                   unsigned argc,                                \
                   JS::Value *vp)                                \
@@ -72,7 +72,7 @@ fill_rectangle(JSContext *context, JSObject *obj,
         cairo_region_t *other_region;                           \
         if (!gjs_parse_call_args(context, #method, "o", argv,   \
                             "other_region", &other_obj))        \
-            return JS_FALSE;                                    \
+            return false;                                       \
                                                                 \
         this_region = get_region(context, obj);                 \
         other_region = get_region(context, other_obj);          \
@@ -83,7 +83,7 @@ fill_rectangle(JSContext *context, JSObject *obj,
     }
 
 #define REGION_DEFINE_RECT_FUNC(method)                         \
-    static JSBool                                               \
+    static bool                                                 \
     method##_rectangle_func(JSContext *context,                 \
                             unsigned argc,                      \
                             JS::Value *vp)                      \
@@ -93,10 +93,10 @@ fill_rectangle(JSContext *context, JSObject *obj,
         cairo_rectangle_int_t rect;                             \
         if (!gjs_parse_call_args(context, #method, "o", argv,   \
                             "rect", &rect_obj))                 \
-            return JS_FALSE;                                    \
+            return false;                                       \
                                                                 \
         if (!fill_rectangle(context, rect_obj, &rect))          \
-            return JS_FALSE;                                    \
+            return false;                                       \
                                                                 \
         cairo_region_##method##_rectangle(this_region, &rect);  \
             argv.rval().setUndefined();                         \
@@ -113,33 +113,33 @@ REGION_DEFINE_RECT_FUNC(subtract)
 REGION_DEFINE_RECT_FUNC(intersect)
 REGION_DEFINE_RECT_FUNC(xor)
 
-static JSBool
+static bool
 fill_rectangle(JSContext *context, JSObject *obj,
                cairo_rectangle_int_t *rect)
 {
     JS::Value val;
 
     if (!gjs_object_get_property_const(context, obj, GJS_STRING_X, &val))
-        return JS_FALSE;
+        return false;
     if (!JS_ValueToInt32(context, val, &rect->x))
-        return JS_FALSE;
+        return false;
 
     if (!gjs_object_get_property_const(context, obj, GJS_STRING_Y, &val))
-        return JS_FALSE;
+        return false;
     if (!JS_ValueToInt32(context, val, &rect->y))
-        return JS_FALSE;
+        return false;
 
     if (!gjs_object_get_property_const(context, obj, GJS_STRING_WIDTH, &val))
-        return JS_FALSE;
+        return false;
     if (!JS_ValueToInt32(context, val, &rect->width))
-        return JS_FALSE;
+        return false;
 
     if (!gjs_object_get_property_const(context, obj, GJS_STRING_HEIGHT, &val))
-        return JS_FALSE;
+        return false;
     if (!JS_ValueToInt32(context, val, &rect->height))
-        return JS_FALSE;
+        return false;
 
-    return JS_TRUE;
+    return true;
 }
 
 static JSObject *
@@ -164,7 +164,7 @@ make_rectangle(JSContext *context,
     return rect_obj;
 }
 
-static JSBool
+static bool
 num_rectangles_func(JSContext *context,
                     unsigned argc,
                     JS::Value *vp)
@@ -173,14 +173,14 @@ num_rectangles_func(JSContext *context,
     int n_rects;
 
     if (!gjs_parse_call_args(context, "num_rectangles", "", argv))
-        return JS_FALSE;
+        return false;
 
     n_rects = cairo_region_num_rectangles(this_region);
     argv.rval().setInt32(n_rects);
     RETURN_STATUS;
 }
 
-static JSBool
+static bool
 get_rectangle_func(JSContext *context,
                    unsigned argc,
                    JS::Value *vp)
@@ -191,7 +191,7 @@ get_rectangle_func(JSContext *context,
     cairo_rectangle_int_t rect;
 
     if (!gjs_parse_call_args(context, "get_rectangle", "i", argv, "rect", &i))
-        return JS_FALSE;
+        return false;
 
     cairo_region_get_rectangle(this_region, i, &rect);
     rect_obj = make_rectangle(context, &rect);
@@ -245,7 +245,7 @@ GJS_NATIVE_CONSTRUCTOR_DECLARE(cairo_region)
     GJS_NATIVE_CONSTRUCTOR_PRELUDE(cairo_region);
 
     if (!gjs_parse_call_args(context, "Region", "", argv))
-        return JS_FALSE;
+        return false;
 
     region = cairo_region_create();
 
@@ -254,7 +254,7 @@ GJS_NATIVE_CONSTRUCTOR_DECLARE(cairo_region)
 
     GJS_NATIVE_CONSTRUCTOR_FINISH(cairo_region);
 
-    return JS_TRUE;
+    return true;
 }
 
 static void
@@ -285,7 +285,7 @@ gjs_cairo_region_from_region(JSContext *context,
     return object;
 }
 
-static JSBool
+static bool
 region_to_g_argument(JSContext      *context,
                      JS::Value       value,
                      const char     *arg_name,
@@ -300,15 +300,15 @@ region_to_g_argument(JSContext      *context,
     obj = &value.toObject();
     region = get_region(context, obj);
     if (!region)
-        return JS_FALSE;
+        return false;
     if (transfer == GI_TRANSFER_EVERYTHING)
         cairo_region_destroy(region);
 
     arg->v_pointer = region;
-    return JS_TRUE;
+    return true;
 }
 
-static JSBool
+static bool
 region_from_g_argument(JSContext  *context,
                        JS::Value  *value_p,
                        GArgument  *arg)
@@ -317,19 +317,19 @@ region_from_g_argument(JSContext  *context,
 
     obj = gjs_cairo_region_from_region(context, (cairo_region_t*)arg->v_pointer);
     if (!obj)
-        return JS_FALSE;
+        return false;
 
     *value_p = JS::ObjectValue(*obj);
-    return JS_TRUE;
+    return true;
 }
 
-static JSBool
+static bool
 region_release_argument(JSContext  *context,
                         GITransfer  transfer,
                         GArgument  *arg)
 {
     cairo_region_destroy((cairo_region_t*)arg->v_pointer);
-    return JS_TRUE;
+    return true;
 }
 
 static GjsForeignInfo foreign_info = {
diff --git a/modules/cairo-solid-pattern.cpp b/modules/cairo-solid-pattern.cpp
index 692f8c2..8ecb1a4 100644
--- a/modules/cairo-solid-pattern.cpp
+++ b/modules/cairo-solid-pattern.cpp
@@ -40,7 +40,7 @@ JSPropertySpec gjs_cairo_solid_pattern_proto_props[] = {
     { NULL }
 };
 
-static JSBool
+static bool
 createRGB_func(JSContext *context,
                unsigned   argc,
                JS::Value *vp)
@@ -54,21 +54,21 @@ createRGB_func(JSContext *context,
                         "red", &red,
                         "green", &green,
                         "blue", &blue))
-        return JS_FALSE;
+        return false;
 
     pattern = cairo_pattern_create_rgb(red, green, blue);
     if (!gjs_cairo_check_status(context, cairo_pattern_status(pattern), "pattern"))
-        return JS_FALSE;
+        return false;
 
     pattern_wrapper = gjs_cairo_solid_pattern_from_pattern(context, pattern);
     cairo_pattern_destroy(pattern);
 
     argv.rval().setObjectOrNull(pattern_wrapper);
 
-    return JS_TRUE;
+    return true;
 }
 
-static JSBool
+static bool
 createRGBA_func(JSContext *context,
                 unsigned   argc,
                 JS::Value *vp)
@@ -83,18 +83,18 @@ createRGBA_func(JSContext *context,
                         "green", &green,
                         "blue", &blue,
                         "alpha", &alpha))
-        return JS_FALSE;
+        return false;
 
     pattern = cairo_pattern_create_rgba(red, green, blue, alpha);
     if (!gjs_cairo_check_status(context, cairo_pattern_status(pattern), "pattern"))
-        return JS_FALSE;
+        return false;
 
     pattern_wrapper = gjs_cairo_solid_pattern_from_pattern(context, pattern);
     cairo_pattern_destroy(pattern);
 
     argv.rval().setObjectOrNull(pattern_wrapper);
 
-    return JS_TRUE;
+    return true;
 }
 
 JSFunctionSpec gjs_cairo_solid_pattern_proto_funcs[] = {
diff --git a/modules/cairo-surface-pattern.cpp b/modules/cairo-surface-pattern.cpp
index 7600ad8..4598e5a 100644
--- a/modules/cairo-surface-pattern.cpp
+++ b/modules/cairo-surface-pattern.cpp
@@ -40,25 +40,25 @@ GJS_NATIVE_CONSTRUCTOR_DECLARE(cairo_surface_pattern)
 
     if (!gjs_parse_call_args(context, "SurfacePattern", "o", argv,
                         "surface", &surface_wrapper))
-        return JS_FALSE;
+        return false;
 
     surface = gjs_cairo_surface_get_surface(context, surface_wrapper);
     if (!surface) {
         gjs_throw(context, "first argument to SurfacePattern() should be a surface");
-        return JS_FALSE;
+        return false;
     }
 
     pattern = cairo_pattern_create_for_surface(surface);
 
     if (!gjs_cairo_check_status(context, cairo_pattern_status(pattern), "pattern"))
-        return JS_FALSE;
+        return false;
 
     gjs_cairo_pattern_construct(context, object, pattern);
     cairo_pattern_destroy(pattern);
 
     GJS_NATIVE_CONSTRUCTOR_FINISH(cairo_surface_pattern);
 
-    return JS_TRUE;
+    return true;
 }
 
 
@@ -74,7 +74,7 @@ JSPropertySpec gjs_cairo_surface_pattern_proto_props[] = {
 };
 
 
-static JSBool
+static bool
 setExtend_func(JSContext *context,
                unsigned   argc,
                JS::Value *vp)
@@ -87,19 +87,19 @@ setExtend_func(JSContext *context,
 
     if (!gjs_parse_call_args(context, "setExtend", "i", argv,
                         "extend", &extend))
-        return JS_FALSE;
+        return false;
 
     pattern = gjs_cairo_pattern_get_pattern(context, obj);
     cairo_pattern_set_extend(pattern, extend);
 
     if (!gjs_cairo_check_status(context, cairo_pattern_status(pattern), "pattern"))
-        return JS_FALSE;
+        return false;
 
     argv.rval().setUndefined();
-    return JS_TRUE;
+    return true;
 }
 
-static JSBool
+static bool
 getExtend_func(JSContext *context,
                unsigned   argc,
                JS::Value *vp)
@@ -112,21 +112,21 @@ getExtend_func(JSContext *context,
 
     if (argc > 0) {
         gjs_throw(context, "SurfacePattern.getExtend() requires no arguments");
-        return JS_FALSE;
+        return false;
     }
 
     pattern = gjs_cairo_pattern_get_pattern(context, obj);
     extend = cairo_pattern_get_extend(pattern);
 
     if (!gjs_cairo_check_status(context, cairo_pattern_status(pattern), "pattern"))
-        return JS_FALSE;
+        return false;
 
     rec.rval().setInt32(extend);
 
-    return JS_TRUE;
+    return true;
 }
 
-static JSBool
+static bool
 setFilter_func(JSContext *context,
                unsigned   argc,
                JS::Value *vp)
@@ -139,19 +139,19 @@ setFilter_func(JSContext *context,
 
     if (!gjs_parse_call_args(context, "setFilter", "i", argv,
                         "filter", &filter))
-        return JS_FALSE;
+        return false;
 
     pattern = gjs_cairo_pattern_get_pattern(context, obj);
     cairo_pattern_set_filter(pattern, filter);
 
     if (!gjs_cairo_check_status(context, cairo_pattern_status(pattern), "pattern"))
-        return JS_FALSE;
+        return false;
 
     argv.rval().setUndefined();
-    return JS_TRUE;
+    return true;
 }
 
-static JSBool
+static bool
 getFilter_func(JSContext *context,
                unsigned   argc,
                JS::Value *vp)
@@ -164,18 +164,18 @@ getFilter_func(JSContext *context,
 
     if (argc > 0) {
         gjs_throw(context, "SurfacePattern.getFilter() requires no arguments");
-        return JS_FALSE;
+        return false;
     }
 
     pattern = gjs_cairo_pattern_get_pattern(context, obj);
     filter = cairo_pattern_get_filter(pattern);
 
     if (!gjs_cairo_check_status(context, cairo_pattern_status(pattern), "pattern"))
-        return JS_FALSE;
+        return false;
 
     rec.rval().setInt32(filter);
 
-    return JS_TRUE;
+    return true;
 }
 
 JSFunctionSpec gjs_cairo_surface_pattern_proto_funcs[] = {
diff --git a/modules/cairo-surface.cpp b/modules/cairo-surface.cpp
index dcfbd97..3044022 100644
--- a/modules/cairo-surface.cpp
+++ b/modules/cairo-surface.cpp
@@ -57,7 +57,7 @@ JSPropertySpec gjs_cairo_surface_proto_props[] = {
 };
 
 /* Methods */
-static JSBool
+static bool
 writeToPNG_func(JSContext *context,
                 unsigned   argc,
                 JS::Value *vp)
@@ -70,23 +70,23 @@ writeToPNG_func(JSContext *context,
 
     if (!gjs_parse_call_args(context, "writeToPNG", "s", argv,
                         "filename", &filename))
-        return JS_FALSE;
+        return false;
 
     surface = gjs_cairo_surface_get_surface(context, obj);
     if (!surface) {
         g_free(filename);
-        return JS_FALSE;
+        return false;
     }
     cairo_surface_write_to_png(surface, filename);
     g_free(filename);
     if (!gjs_cairo_check_status(context, cairo_surface_status(surface),
                                 "surface"))
-        return JS_FALSE;
+        return false;
     argv.rval().setUndefined();
-    return JS_TRUE;
+    return true;
 }
 
-static JSBool
+static bool
 getType_func(JSContext *context,
              unsigned   argc,
              JS::Value *vp)
@@ -99,17 +99,17 @@ getType_func(JSContext *context,
 
     if (argc > 1) {
         gjs_throw(context, "Surface.getType() takes no arguments");
-        return JS_FALSE;
+        return false;
     }
 
     surface = gjs_cairo_surface_get_surface(context, obj);
     type = cairo_surface_get_type(surface);
     if (!gjs_cairo_check_status(context, cairo_surface_status(surface),
                                 "surface"))
-        return JS_FALSE;
+        return false;
 
     rec.rval().setInt32(type);
-    return JS_TRUE;
+    return true;
 }
 
 JSFunctionSpec gjs_cairo_surface_proto_funcs[] = {
@@ -248,7 +248,7 @@ gjs_cairo_surface_get_surface(JSContext *context,
     return priv->surface;
 }
 
-static JSBool
+static bool
 surface_to_g_argument(JSContext      *context,
                       JS::Value       value,
                       const char     *arg_name,
@@ -263,15 +263,15 @@ surface_to_g_argument(JSContext      *context,
     obj = &value.toObject();
     s = gjs_cairo_surface_get_surface(context, obj);
     if (!s)
-        return JS_FALSE;
+        return false;
     if (transfer == GI_TRANSFER_EVERYTHING)
         cairo_surface_destroy(s);
 
     arg->v_pointer = s;
-    return JS_TRUE;
+    return true;
 }
 
-static JSBool
+static bool
 surface_from_g_argument(JSContext  *context,
                         JS::Value  *value_p,
                         GArgument  *arg)
@@ -280,19 +280,19 @@ surface_from_g_argument(JSContext  *context,
 
     obj = gjs_cairo_surface_from_surface(context, (cairo_surface_t*)arg->v_pointer);
     if (!obj)
-        return JS_FALSE;
+        return false;
 
     *value_p = JS::ObjectValue(*obj);
-    return JS_TRUE;
+    return true;
 }
 
-static JSBool
+static bool
 surface_release_argument(JSContext  *context,
                          GITransfer  transfer,
                          GArgument  *arg)
 {
     cairo_surface_destroy((cairo_surface_t*)arg->v_pointer);
-    return JS_TRUE;
+    return true;
 }
 
 static GjsForeignInfo foreign_info = {
diff --git a/modules/cairo-svg-surface.cpp b/modules/cairo-svg-surface.cpp
index 45b1dc2..d95d00c 100644
--- a/modules/cairo-svg-surface.cpp
+++ b/modules/cairo-svg-surface.cpp
@@ -45,14 +45,14 @@ GJS_NATIVE_CONSTRUCTOR_DECLARE(cairo_svg_surface)
                         "filename", &filename,
                         "width", &width,
                         "height", &height))
-        return JS_FALSE;
+        return false;
 
     surface = cairo_svg_surface_create(filename, width, height);
 
     if (!gjs_cairo_check_status(context, cairo_surface_status(surface),
                                 "surface")) {
         g_free(filename);
-        return JS_FALSE;
+        return false;
     }
 
     gjs_cairo_surface_construct(context, object, surface);
@@ -61,7 +61,7 @@ GJS_NATIVE_CONSTRUCTOR_DECLARE(cairo_svg_surface)
 
     GJS_NATIVE_CONSTRUCTOR_FINISH(cairo_svg_surface);
 
-    return JS_TRUE;
+    return true;
 }
 
 static void
diff --git a/modules/cairo.cpp b/modules/cairo.cpp
index e1885f4..1a840c4 100644
--- a/modules/cairo.cpp
+++ b/modules/cairo.cpp
@@ -40,7 +40,7 @@ class XLibConstructor {
 static XLibConstructor constructor;
 #endif
 
-JSBool
+bool
 gjs_cairo_check_status(JSContext      *context,
                        cairo_status_t  status,
                        const char     *name)
@@ -50,13 +50,13 @@ gjs_cairo_check_status(JSContext      *context,
                   name,
                   cairo_status_to_string(status),
                   status);
-        return JS_FALSE;
+        return false;
     }
 
-    return JS_TRUE;
+    return true;
 }
 
-JSBool
+bool
 gjs_js_define_cairo_stuff(JSContext *context,
                           JSObject **module_out)
 {
@@ -69,82 +69,82 @@ gjs_js_define_cairo_stuff(JSContext *context,
     obj = gjs_cairo_region_create_proto(context, module,
                                         "Region", NULL);
     if (obj.isNull())
-        return JS_FALSE;
+        return false;
     gjs_cairo_region_init(context);
 
     obj = gjs_cairo_context_create_proto(context, module,
                                          "Context", NULL);
     if (obj.isNull())
-        return JS_FALSE;
+        return false;
     gjs_cairo_context_init(context);
     gjs_cairo_surface_init(context);
 
     obj = gjs_cairo_surface_create_proto(context, module,
                                          "Surface", NULL);
     if (obj.isNull())
-        return JS_FALSE;
+        return false;
     surface_proto = &obj.toObject();
 
     obj = gjs_cairo_image_surface_create_proto(context, module,
                                                "ImageSurface", surface_proto);
     if (obj.isNull())
-        return JS_FALSE;
+        return false;
     gjs_cairo_image_surface_init(context, &obj.toObject());
 
 #if CAIRO_HAS_PS_SURFACE
     obj = gjs_cairo_ps_surface_create_proto(context, module,
                                             "PSSurface", surface_proto);
     if (obj.isNull())
-        return JS_FALSE;
+        return false;
 #endif
 
 #if CAIRO_HAS_PDF_SURFACE
     obj = gjs_cairo_pdf_surface_create_proto(context, module,
                                              "PDFSurface", surface_proto);
     if (obj.isNull())
-        return JS_FALSE;
+        return false;
 #endif
 
 #if CAIRO_HAS_SVG_SURFACE
     obj = gjs_cairo_svg_surface_create_proto(context, module,
                                              "SVGSurface", surface_proto);
     if (obj.isNull())
-        return JS_FALSE;
+        return false;
 #endif
 
     obj = gjs_cairo_pattern_create_proto(context, module,
                                          "Pattern", NULL);
     if (obj.isNull())
-        return JS_FALSE;
+        return false;
     pattern_proto = &obj.toObject();
 
     obj = gjs_cairo_gradient_create_proto(context, module,
                                          "Gradient", pattern_proto);
     if (obj.isNull())
-        return JS_FALSE;
+        return false;
     gradient_proto = &obj.toObject();
 
     obj = gjs_cairo_linear_gradient_create_proto(context, module,
                                                  "LinearGradient", gradient_proto);
     if (obj.isNull())
-        return JS_FALSE;
+        return false;
 
     obj = gjs_cairo_radial_gradient_create_proto(context, module,
                                                  "RadialGradient", gradient_proto);
     if (obj.isNull())
-        return JS_FALSE;
+        return false;
 
     obj = gjs_cairo_surface_pattern_create_proto(context, module,
                                                  "SurfacePattern", pattern_proto);
     if (obj.isNull())
-        return JS_FALSE;
+        return false;
 
     obj = gjs_cairo_solid_pattern_create_proto(context, module,
                                                "SolidPattern", pattern_proto);
     if (obj.isNull())
-        return JS_FALSE;
+        return false;
 
     *module_out = module;
 
-    return JS_TRUE;
+    return true;
 }
diff --git a/modules/console.cpp b/modules/console.cpp
index 9fc9d8d..230626d 100644
--- a/modules/console.cpp
+++ b/modules/console.cpp
@@ -128,33 +128,33 @@ gjs_console_error_reporter(JSContext *cx, const char *message, JSErrorReport *re
 }
 
 #ifdef HAVE_LIBREADLINE
-static JSBool
+static bool
 gjs_console_readline(JSContext *cx, char **bufp, FILE *file, const char *prompt)
 {
     char *line;
     line = readline(prompt);
     if (!line)
-        return JS_FALSE;
+        return false;
     if (line[0] != '\0')
         add_history(line);
     *bufp = line;
-    return JS_TRUE;
+    return true;
 }
 #else
-static JSBool
+static bool
 gjs_console_readline(JSContext *cx, char **bufp, FILE *file, const char *prompt)
 {
     char line[256];
     fprintf(stdout, "%s", prompt);
     fflush(stdout);
     if (!fgets(line, sizeof line, file))
-        return JS_FALSE;
+        return false;
     *bufp = g_strdup(line);
-    return JS_TRUE;
+    return true;
 }
 #endif
 
-JSBool
+bool
 gjs_console_interact(JSContext *context,
                      unsigned   argc,
                      JS::Value *vp)
@@ -186,7 +186,7 @@ gjs_console_interact(JSContext *context,
         do {
             if (!gjs_console_readline(context, &temp_buf, file,
                                       startline == lineno ? "gjs> " : ".... ")) {
-                eof = JS_TRUE;
+                eof = true;
                 break;
             }
             g_string_append(buffer, temp_buf);
@@ -229,10 +229,10 @@ gjs_console_interact(JSContext *context,
     if (file != stdin)
         fclose(file);
 
-    return JS_TRUE;
+    return true;
 }
 
-JSBool
+bool
 gjs_define_console_stuff(JSContext  *context,
                          JSObject  **module_out)
 {
@@ -244,8 +244,8 @@ gjs_define_console_stuff(JSContext  *context,
                            "interact",
                            (JSNative) gjs_console_interact,
                            1, GJS_MODULE_PROP_FLAGS))
-        return JS_FALSE;
+        return false;
 
     *module_out = module;
-    return JS_TRUE;
+    return true;
 }
diff --git a/modules/console.h b/modules/console.h
index 8b6499d..2d41d65 100644
--- a/modules/console.h
+++ b/modules/console.h
@@ -30,11 +30,11 @@
 
 G_BEGIN_DECLS
 
-JSBool        gjs_define_console_stuff     (JSContext      *context,
-                                            JSObject      **module_out);
-JSBool        gjs_console_interact         (JSContext      *context,
-                                            unsigned        argc,
-                                            JS::Value      *vp);
+bool        gjs_define_console_stuff     (JSContext      *context,
+                                          JSObject      **module_out);
+bool        gjs_console_interact         (JSContext      *context,
+                                          unsigned        argc,
+                                          JS::Value      *vp);
 
 G_END_DECLS
 
diff --git a/modules/system.cpp b/modules/system.cpp
index 1a16c8f..333f86a 100644
--- a/modules/system.cpp
+++ b/modules/system.cpp
@@ -39,12 +39,12 @@ gjs_address_of(JSContext *context,
 {
     JS::CallArgs argv = JS::CallArgsFromVp (argc, vp);
     JSObject *target_obj;
-    JSBool ret;
+    bool ret;
     char *pointer_string;
     JS::Value retval;
 
     if (!gjs_parse_call_args(context, "addressOf", "o", argv, "object", &target_obj))
-        return JS_FALSE;
+        return false;
 
     pointer_string = g_strdup_printf("%p", target_obj);
 
@@ -67,18 +67,17 @@ gjs_refcount(JSContext *context,
     GObject *obj;
 
     if (!gjs_parse_call_args(context, "refcount", "o", argv, "object", &target_obj))
-        return JS_FALSE;
+        return false;
 
-    if (!gjs_typecheck_object(context, target_obj,
-                              G_TYPE_OBJECT, JS_TRUE))
-        return JS_FALSE;
+    if (!gjs_typecheck_object(context, target_obj, G_TYPE_OBJECT, true))
+        return false;
 
     obj = gjs_g_object_from_object(context, target_obj);
     if (obj == NULL)
-        return JS_FALSE;
+        return false;
 
     argv.rval().setInt32(obj->ref_count);
-    return JS_TRUE;
+    return true;
 }
 
 static JSBool
@@ -88,10 +87,10 @@ gjs_breakpoint(JSContext *context,
 {
     JS::CallArgs argv = JS::CallArgsFromVp (argc, vp);
     if (!gjs_parse_call_args(context, "breakpoint", "", argv))
-        return JS_FALSE;
+        return false;
     G_BREAKPOINT();
     argv.rval().setUndefined();
-    return JS_TRUE;
+    return true;
 }
 
 static JSBool
@@ -101,10 +100,10 @@ gjs_gc(JSContext *context,
 {
     JS::CallArgs argv = JS::CallArgsFromVp (argc, vp);
     if (!gjs_parse_call_args(context, "gc", "", argv))
-        return JS_FALSE;
+        return false;
     JS_GC(JS_GetRuntime(context));
     argv.rval().setUndefined();
-    return JS_TRUE;
+    return true;
 }
 
 static JSBool
@@ -115,9 +114,9 @@ gjs_exit(JSContext *context,
     JS::CallArgs argv = JS::CallArgsFromVp (argc, vp);
     gint32 ecode;
     if (!gjs_parse_call_args(context, "exit", "i", argv, "ecode", &ecode))
-        return JS_FALSE;
+        return false;
     exit(ecode);
-    return JS_TRUE;
+    return true;
 }
 
 static JSBool
@@ -136,7 +135,7 @@ gjs_clear_date_caches(JSContext *context,
     JS_EndRequest(context);
 
     rec.rval().setUndefined();
-    return JS_TRUE;
+    return true;
 }
 
 static JSFunctionSpec module_funcs[] = {
@@ -149,22 +148,22 @@ static JSFunctionSpec module_funcs[] = {
     { NULL },
 };
 
-JSBool
+bool
 gjs_js_define_system_stuff(JSContext  *context,
                            JSObject  **module_out)
 {
     GjsContext *gjs_context;
     char *program_name;
     JS::Value value;
-    JSBool retval;
+    bool retval;
     JSObject *module;
 
     module = JS_NewObject (context, NULL, NULL, NULL);
 
     if (!JS_DefineFunctions(context, module, &module_funcs[0]))
-        return JS_FALSE;
+        return false;
 
-    retval = JS_FALSE;
+    retval = false;
 
     gjs_context = (GjsContext*) JS_GetContextPrivate(context);
     g_object_get(gjs_context,
@@ -193,7 +192,7 @@ gjs_js_define_system_stuff(JSContext  *context,
                            GJS_MODULE_PROP_FLAGS | JSPROP_READONLY))
         goto out;
 
-    retval = JS_TRUE;
+    retval = true;
 
  out:
     g_free(program_name);
diff --git a/modules/system.h b/modules/system.h
index 608de0e..f6984ab 100644
--- a/modules/system.h
+++ b/modules/system.h
@@ -31,8 +31,8 @@
 
 G_BEGIN_DECLS
 
-JSBool        gjs_js_define_system_stuff     (JSContext      *context,
-                                              JSObject      **module_out);
+bool        gjs_js_define_system_stuff     (JSContext      *context,
+                                            JSObject      **module_out);
 
 G_END_DECLS
 
diff --git a/test/gjs-tests.cpp b/test/gjs-tests.cpp
index 3149d6e..7aa17bd 100644
--- a/test/gjs-tests.cpp
+++ b/test/gjs-tests.cpp
@@ -150,9 +150,9 @@ gjstest_test_func_gjs_jsapi_util_string_js_string_utf8(void)
     global = gjs_get_global_object(context);
     JSCompartment *oldCompartment = JS_EnterCompartment(context, global);
 
-    g_assert(gjs_string_from_utf8(context, utf8_string, -1, &js_string) == JS_TRUE);
+    g_assert(gjs_string_from_utf8(context, utf8_string, -1, &js_string));
     g_assert(js_string.isString());
-    g_assert(gjs_string_to_utf8(context, js_string, &utf8_result) == JS_TRUE);
+    g_assert(gjs_string_to_utf8(context, js_string, &utf8_result));
 
     JS_LeaveCompartment(context, oldCompartment);
     _gjs_unit_test_fixture_finish(&fixture);



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