[gjs/wip/ptomato/mozjs38: 8/14] gerror: Root define_error_properties()
- From: Philip Chimento <pchimento src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs/wip/ptomato/mozjs38: 8/14] gerror: Root define_error_properties()
- Date: Wed, 11 Jan 2017 07:57:06 +0000 (UTC)
commit cda8ea9cafab1525e0194ea13299b1cbe5c75914
Author: Philip Chimento <philip chimento gmail com>
Date: Tue Jan 10 19:07:22 2017 -0800
gerror: Root define_error_properties()
This function now requires a rooted object, since the
JS_DefinePropertyById() calls require one as well.
https://bugzilla.gnome.org/show_bug.cgi?id=776966
gi/gerror.cpp | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/gi/gerror.cpp b/gi/gerror.cpp
index 001e2fc..4e7e5c6 100644
--- a/gi/gerror.cpp
+++ b/gi/gerror.cpp
@@ -44,7 +44,7 @@ typedef struct {
extern struct JSClass gjs_error_class;
-static void define_error_properties(JSContext *, JSObject *);
+static void define_error_properties(JSContext *, JS::HandleObject);
GJS_DEFINE_PRIV_FROM_JS(Error, gjs_error_class)
@@ -396,8 +396,8 @@ find_error_domain_info(GQuark domain)
fileName, lineNumber and stack
*/
static void
-define_error_properties(JSContext *context,
- JSObject *obj)
+define_error_properties(JSContext *context,
+ JS::HandleObject obj)
{
JS::RootedValue stack(context), fileName(context), lineNumber(context);
/* COMPAT: mozilla::Maybe gains a much more usable API in future versions */
@@ -431,7 +431,6 @@ gjs_error_from_gerror(JSContext *context,
GError *gerror,
bool add_stack)
{
- JSObject *obj;
Error *priv;
Error *proto_priv;
GIEnumInfo *info;
@@ -462,7 +461,8 @@ gjs_error_from_gerror(JSContext *context,
JS::RootedObject global(context, gjs_get_import_global(context));
proto_priv = priv_from_js(context, proto);
- obj = JS_NewObjectWithGivenProto(context, JS_GetClass(proto), proto, global);
+ JS::RootedObject obj(context,
+ JS_NewObjectWithGivenProto(context, JS_GetClass(proto), proto, global));
GJS_INC_COUNTER(gerror);
priv = g_slice_new0(Error);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]