summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Lunn <tim@feathertop.org>2013-01-03 15:08:19 +1100
committerRico Tzschichholz <ricotz@ubuntu.com>2013-03-24 14:28:35 +0100
commit59795adb7b097374b4a5153833547c1de6e4a73e (patch)
treed53f3ec2c89f9df78a58bc1ec7e6b57e2a86bf41
parentae430f1c5f9ebdc5a8021d3f6a0b83702c111fe4 (diff)
downloadgjs-59795adb7b097374b4a5153833547c1de6e4a73e.tar.gz
Context argument removed from several API
JS_SetPrivate/JS_GetPrivate/JS_GetPrototype no longer require context as first arg. https://bugzilla.gnome.org/show_bug.cgi?id=690982
-rw-r--r--gi/boxed.c10
-rw-r--r--gi/function.c4
-rw-r--r--gi/gerror.c8
-rw-r--r--gi/gtype.c2
-rw-r--r--gi/interface.c2
-rw-r--r--gi/keep-alive.c4
-rw-r--r--gi/ns.c2
-rw-r--r--gi/object.c8
-rw-r--r--gi/param.c2
-rw-r--r--gi/repo.c2
-rw-r--r--gi/union.c8
-rw-r--r--gjs/byteArray.c8
-rw-r--r--gjs/importer.c2
-rw-r--r--gjs/jsapi-dynamic-class.c2
-rw-r--r--gjs/jsapi-util.c2
-rw-r--r--modules/cairo-context.c2
-rw-r--r--modules/cairo-path.c6
-rw-r--r--modules/cairo-pattern.c6
-rw-r--r--modules/cairo-surface.c6
19 files changed, 43 insertions, 43 deletions
diff --git a/gi/boxed.c b/gi/boxed.c
index bbea2c7a..464834e1 100644
--- a/gi/boxed.c
+++ b/gi/boxed.c
@@ -443,13 +443,13 @@ GJS_NATIVE_CONSTRUCTOR_DECLARE(boxed)
GJS_INC_COUNTER(boxed);
g_assert(priv_from_js(context, object) == NULL);
- JS_SetPrivate(context, object, priv);
+ JS_SetPrivate(object, priv);
gjs_debug_lifecycle(GJS_DEBUG_GBOXED,
"boxed constructor, obj %p priv %p",
object, priv);
- proto = JS_GetPrototype(context, object);
+ proto = JS_GetPrototype(object);
gjs_debug_lifecycle(GJS_DEBUG_GBOXED, "boxed instance __proto__ is %p", proto);
/* If we're the prototype, then post-construct we'll fill in priv->info.
* If we are not the prototype, though, then we'll get ->info from the
@@ -606,7 +606,7 @@ get_nested_interface_object (JSContext *context,
GJS_INC_COUNTER(boxed);
priv = g_slice_new0(Boxed);
- JS_SetPrivate(context, obj, priv);
+ JS_SetPrivate(obj, priv);
priv->info = (GIBoxedInfo*) interface_info;
g_base_info_ref( (GIBaseInfo*) priv->info);
priv->gtype = g_registered_type_info_get_g_type ((GIRegisteredTypeInfo*) interface_info);
@@ -1239,7 +1239,7 @@ gjs_define_boxed_class(JSContext *context,
g_base_info_ref( (GIBaseInfo*) priv->info);
priv->gtype = g_registered_type_info_get_g_type ((GIRegisteredTypeInfo*) priv->info);
- JS_SetPrivate(context, prototype, priv);
+ JS_SetPrivate(prototype, priv);
gjs_debug(GJS_DEBUG_GBOXED, "Defined class %s prototype is %p class %p in object %p",
constructor_name, prototype, JS_GetClass(prototype), in_object);
@@ -1293,7 +1293,7 @@ gjs_boxed_from_c_struct(JSContext *context,
*priv = *proto_priv;
g_base_info_ref( (GIBaseInfo*) priv->info);
- JS_SetPrivate(context, obj, priv);
+ JS_SetPrivate(obj, priv);
if ((flags & GJS_BOXED_CREATION_NO_COPY) != 0) {
/* we need to create a JS Boxed which references the
diff --git a/gi/function.c b/gi/function.c
index a37fb85e..1d9f2ad3 100644
--- a/gi/function.c
+++ b/gi/function.c
@@ -1549,7 +1549,7 @@ function_new(JSContext *context,
JS_GetProperty(context, global, "Function", &native_function);
/* We take advantage from that fact that Function.__proto__ is Function.prototype */
- parent_proto = JS_GetPrototype(context, JSVAL_TO_OBJECT(native_function));
+ parent_proto = JS_GetPrototype(JSVAL_TO_OBJECT(native_function));
prototype = JS_InitClass(context, global,
/* parent prototype JSObject* for
@@ -1594,7 +1594,7 @@ function_new(JSContext *context,
GJS_INC_COUNTER(function);
g_assert(priv_from_js(context, function) == NULL);
- JS_SetPrivate(context, function, priv);
+ JS_SetPrivate(function, priv);
gjs_debug_lifecycle(GJS_DEBUG_GFUNCTION,
"function constructor, obj %p priv %p", function, priv);
diff --git a/gi/gerror.c b/gi/gerror.c
index ea36b181..5fd12b67 100644
--- a/gi/gerror.c
+++ b/gi/gerror.c
@@ -77,13 +77,13 @@ GJS_NATIVE_CONSTRUCTOR_DECLARE(error)
GJS_INC_COUNTER(gerror);
g_assert(priv_from_js(context, object) == NULL);
- JS_SetPrivate(context, object, priv);
+ JS_SetPrivate(object, priv);
gjs_debug_lifecycle(GJS_DEBUG_GERROR,
"GError constructor, obj %p priv %p",
object, priv);
- proto = JS_GetPrototype(context, object);
+ proto = JS_GetPrototype(object);
gjs_debug_lifecycle(GJS_DEBUG_GERROR, "GError instance __proto__ is %p", proto);
/* If we're the prototype, then post-construct we'll fill in priv->info.
@@ -460,7 +460,7 @@ gjs_define_error_class(JSContext *context,
g_base_info_ref( (GIBaseInfo*) priv->info);
priv->domain = g_quark_from_string (g_enum_info_get_error_domain(priv->info));
- JS_SetPrivate(context, prototype, priv);
+ JS_SetPrivate(prototype, priv);
gjs_debug(GJS_DEBUG_GBOXED, "Defined class %s prototype is %p class %p in object %p",
constructor_name, prototype, JS_GetClass(prototype), in_object);
@@ -595,7 +595,7 @@ gjs_error_from_gerror(JSContext *context,
GJS_INC_COUNTER(gerror);
priv = g_slice_new0(Error);
- JS_SetPrivate(context, obj, priv);
+ JS_SetPrivate(obj, priv);
priv->info = info;
priv->domain = proto_priv->domain;
g_base_info_ref( (GIBaseInfo*) priv->info);
diff --git a/gi/gtype.c b/gi/gtype.c
index ba3954c1..5bcdd6f7 100644
--- a/gi/gtype.c
+++ b/gi/gtype.c
@@ -134,7 +134,7 @@ gjs_gtype_create_gtype_wrapper (JSContext *context,
if (object == NULL)
goto out;
- JS_SetPrivate(context, object, GSIZE_TO_POINTER(gtype));
+ JS_SetPrivate(object, GSIZE_TO_POINTER(gtype));
g_type_set_qdata(gtype, gjs_get_gtype_wrapper_quark(), object);
out:
diff --git a/gi/interface.c b/gi/interface.c
index 43d70193..e447ba49 100644
--- a/gi/interface.c
+++ b/gi/interface.c
@@ -231,7 +231,7 @@ gjs_define_interface_class(JSContext *context,
priv->info = info;
priv->gtype = g_registered_type_info_get_g_type(priv->info);
g_base_info_ref((GIBaseInfo*)priv->info);
- JS_SetPrivate(context, prototype, priv);
+ JS_SetPrivate(prototype, priv);
gjs_define_static_methods(context, constructor, priv->gtype, priv->info);
diff --git a/gi/keep-alive.c b/gi/keep-alive.c
index 581c9adb..ce56e350 100644
--- a/gi/keep-alive.c
+++ b/gi/keep-alive.c
@@ -133,7 +133,7 @@ keep_alive_trace(JSTracer *tracer,
{
KeepAlive *priv;
- priv = JS_GetPrivate(tracer->context, obj);
+ priv = JS_GetPrivate(obj);
if (priv == NULL) /* prototype */
return;
@@ -251,7 +251,7 @@ gjs_keep_alive_new(JSContext *context)
priv->children = g_hash_table_new_full(child_hash, child_equal, NULL, child_free);
g_assert(priv_from_js(context, keep_alive) == NULL);
- JS_SetPrivate(context, keep_alive, priv);
+ JS_SetPrivate(keep_alive, priv);
gjs_debug_lifecycle(GJS_DEBUG_KEEP_ALIVE,
"keep_alive constructor, obj %p priv %p", keep_alive, priv);
diff --git a/gi/ns.c b/gi/ns.c
index 9bf7ef25..8d8930b3 100644
--- a/gi/ns.c
+++ b/gi/ns.c
@@ -230,7 +230,7 @@ ns_new(JSContext *context,
GJS_INC_COUNTER(ns);
g_assert(priv_from_js(context, ns) == NULL);
- JS_SetPrivate(context, ns, priv);
+ JS_SetPrivate(ns, priv);
gjs_debug_lifecycle(GJS_DEBUG_GNAMESPACE, "ns constructor, obj %p priv %p", ns, priv);
diff --git a/gi/object.c b/gi/object.c
index dab446ef..13dfbf92 100644
--- a/gi/object.c
+++ b/gi/object.c
@@ -212,7 +212,7 @@ static inline ObjectInstance *
proto_priv_from_js(JSContext *context,
JSObject *obj)
{
- return priv_from_js(context, JS_GetPrototype(context, obj));
+ return priv_from_js(context, JS_GetPrototype(obj));
}
/* a hook on getting a property; set value_p to override property's value.
@@ -838,7 +838,7 @@ init_object_private (JSContext *context,
GJS_INC_COUNTER(object);
g_assert(priv_from_js(context, object) == NULL);
- JS_SetPrivate(context, object, priv);
+ JS_SetPrivate(object, priv);
gjs_debug_lifecycle(GJS_DEBUG_GOBJECT,
"obj instance constructor, obj %p priv %p", object, priv);
@@ -1026,7 +1026,7 @@ object_instance_trace(JSTracer *tracer,
ObjectInstance *priv;
GList *iter;
- priv = JS_GetPrivate(tracer->context, obj);
+ priv = JS_GetPrivate(obj);
for (iter = priv->signals; iter; iter = iter->next) {
ConnectData *cd = iter->data;
@@ -1689,7 +1689,7 @@ gjs_define_object_class(JSContext *context,
g_base_info_ref( (GIBaseInfo*) priv->info);
priv->gtype = gtype;
priv->klass = g_type_class_ref (gtype);
- JS_SetPrivate(context, prototype, priv);
+ JS_SetPrivate(prototype, priv);
gjs_debug(GJS_DEBUG_GOBJECT, "Defined class %s prototype %p class %p in object %p",
constructor_name, prototype, JS_GetClass(prototype), in_object);
diff --git a/gi/param.c b/gi/param.c
index 8e6d67d5..aaddc5b5 100644
--- a/gi/param.c
+++ b/gi/param.c
@@ -566,7 +566,7 @@ gjs_param_from_g_param(JSContext *context,
GJS_INC_COUNTER(param);
priv = g_slice_new0(Param);
- JS_SetPrivate(context, obj, priv);
+ JS_SetPrivate(obj, priv);
priv->gparam = gparam;
g_param_spec_ref (gparam);
diff --git a/gi/repo.c b/gi/repo.c
index 86dcd193..c14ff7af 100644
--- a/gi/repo.c
+++ b/gi/repo.c
@@ -293,7 +293,7 @@ repo_new(JSContext *context)
GJS_INC_COUNTER(repo);
g_assert(priv_from_js(context, repo) == NULL);
- JS_SetPrivate(context, repo, priv);
+ JS_SetPrivate(repo, priv);
gjs_debug_lifecycle(GJS_DEBUG_GREPO,
"repo constructor, obj %p priv %p", repo, priv);
diff --git a/gi/union.c b/gi/union.c
index bfd7501e..19e34914 100644
--- a/gi/union.c
+++ b/gi/union.c
@@ -202,13 +202,13 @@ GJS_NATIVE_CONSTRUCTOR_DECLARE(union)
GJS_INC_COUNTER(boxed);
g_assert(priv_from_js(context, object) == NULL);
- JS_SetPrivate(context, object, priv);
+ JS_SetPrivate(object, priv);
gjs_debug_lifecycle(GJS_DEBUG_GBOXED,
"union constructor, obj %p priv %p",
object, priv);
- proto = JS_GetPrototype(context, object);
+ proto = JS_GetPrototype(object);
gjs_debug_lifecycle(GJS_DEBUG_GBOXED, "union instance __proto__ is %p", proto);
/* If we're the prototype, then post-construct we'll fill in priv->info.
@@ -460,7 +460,7 @@ gjs_define_union_class(JSContext *context,
priv->info = info;
g_base_info_ref( (GIBaseInfo*) priv->info);
priv->gtype = gtype;
- JS_SetPrivate(context, prototype, priv);
+ JS_SetPrivate(prototype, priv);
gjs_debug(GJS_DEBUG_GBOXED, "Defined class %s prototype is %p class %p in object %p",
constructor_name, prototype, JS_GetClass(prototype), in_object);
@@ -512,7 +512,7 @@ gjs_union_from_c_union(JSContext *context,
GJS_INC_COUNTER(boxed);
priv = g_slice_new0(Union);
- JS_SetPrivate(context, obj, priv);
+ JS_SetPrivate(obj, priv);
priv->info = info;
g_base_info_ref( (GIBaseInfo *) priv->info);
priv->gtype = gtype;
diff --git a/gjs/byteArray.c b/gjs/byteArray.c
index 3b44ecf6..33852b19 100644
--- a/gjs/byteArray.c
+++ b/gjs/byteArray.c
@@ -452,7 +452,7 @@ GJS_NATIVE_CONSTRUCTOR_DECLARE(byte_array)
priv = g_slice_new0(ByteArrayInstance);
priv->array = gjs_g_byte_array_new(preallocated_length);
g_assert(priv_from_js(context, object) == NULL);
- JS_SetPrivate(context, object, priv);
+ JS_SetPrivate(object, priv);
GJS_NATIVE_CONSTRUCTOR_FINISH(byte_array);
@@ -615,7 +615,7 @@ byte_array_new(JSContext *context)
priv = g_slice_new0(ByteArrayInstance);
g_assert(priv_from_js(context, array) == NULL);
- JS_SetPrivate(context, array, priv);
+ JS_SetPrivate(array, priv);
return array;
}
@@ -867,7 +867,7 @@ gjs_byte_array_from_byte_array (JSContext *context,
priv = g_slice_new0(ByteArrayInstance);
g_assert(priv_from_js(context, object) == NULL);
- JS_SetPrivate(context, object, priv);
+ JS_SetPrivate(object, priv);
priv->array = g_byte_array_new();
priv->array->data = g_memdup(array->data, array->len);
priv->array->len = array->len;
@@ -896,7 +896,7 @@ gjs_byte_array_from_bytes (JSContext *context,
priv = g_slice_new0(ByteArrayInstance);
g_assert(priv_from_js(context, object) == NULL);
- JS_SetPrivate(context, object, priv);
+ JS_SetPrivate(object, priv);
priv->bytes = g_bytes_ref (bytes);
return object;
diff --git a/gjs/importer.c b/gjs/importer.c
index fbc98730..7bfc6fdf 100644
--- a/gjs/importer.c
+++ b/gjs/importer.c
@@ -1053,7 +1053,7 @@ importer_new(JSContext *context)
GJS_INC_COUNTER(importer);
g_assert(priv_from_js(context, importer) == NULL);
- JS_SetPrivate(context, importer, priv);
+ JS_SetPrivate(importer, priv);
gjs_debug_lifecycle(GJS_DEBUG_IMPORTER,
"importer constructor, obj %p priv %p", importer, priv);
diff --git a/gjs/jsapi-dynamic-class.c b/gjs/jsapi-dynamic-class.c
index e0df4dca..ab8c5307 100644
--- a/gjs/jsapi-dynamic-class.c
+++ b/gjs/jsapi-dynamic-class.c
@@ -52,7 +52,7 @@ gjs_new_object_for_constructor(JSContext *context,
jsval prototype;
callee = JS_CALLEE(context, vp);
- parent = JS_GetParent(context, JSVAL_TO_OBJECT (callee));
+ parent = JS_GetParent(JSVAL_TO_OBJECT (callee));
if (!gjs_object_get_property(context, JSVAL_TO_OBJECT (callee), "prototype",
&prototype))
diff --git a/gjs/jsapi-util.c b/gjs/jsapi-util.c
index 2bf38be4..5451969a 100644
--- a/gjs/jsapi-util.c
+++ b/gjs/jsapi-util.c
@@ -481,7 +481,7 @@ gjs_explain_scope(JSContext *context,
g_string_append_printf(chain, "%p %s",
parent, debug);
g_free(debug);
- parent = JS_GetParent(context, parent);
+ parent = JS_GetParent(parent);
}
gjs_debug(GJS_DEBUG_SCOPE,
" Chain: %s",
diff --git a/modules/cairo-context.c b/modules/cairo-context.c
index 74534940..091275d9 100644
--- a/modules/cairo-context.c
+++ b/modules/cairo-context.c
@@ -265,7 +265,7 @@ _gjs_cairo_context_construct_internal(JSContext *context,
priv = g_slice_new0(GjsCairoContext);
g_assert(priv_from_js(context, obj) == NULL);
- JS_SetPrivate(context, obj, priv);
+ JS_SetPrivate(obj, priv);
priv->context = context;
priv->object = obj;
diff --git a/modules/cairo-path.c b/modules/cairo-path.c
index de596419..48435fdf 100644
--- a/modules/cairo-path.c
+++ b/modules/cairo-path.c
@@ -41,7 +41,7 @@ gjs_cairo_path_finalize(JSContext *context,
JSObject *obj)
{
GjsCairoPath *priv;
- priv = JS_GetPrivate(context, obj);
+ priv = JS_GetPrivate(obj);
if (priv == NULL)
return;
cairo_path_destroy(priv->path);
@@ -84,7 +84,7 @@ gjs_cairo_path_from_path(JSContext *context,
priv = g_slice_new0(GjsCairoPath);
g_assert(priv_from_js(context, object) == NULL);
- JS_SetPrivate(context, object, priv);
+ JS_SetPrivate(object, priv);
priv->context = context;
priv->object = object;
@@ -111,7 +111,7 @@ gjs_cairo_path_get_path(JSContext *context,
g_return_val_if_fail(context != NULL, NULL);
g_return_val_if_fail(object != NULL, NULL);
- priv = JS_GetPrivate(context, object);
+ priv = JS_GetPrivate(object);
if (priv == NULL)
return NULL;
return priv->path;
diff --git a/modules/cairo-pattern.c b/modules/cairo-pattern.c
index 98b64f2d..cb52b247 100644
--- a/modules/cairo-pattern.c
+++ b/modules/cairo-pattern.c
@@ -42,7 +42,7 @@ gjs_cairo_pattern_finalize(JSContext *context,
JSObject *obj)
{
GjsCairoPattern *priv;
- priv = JS_GetPrivate(context, obj);
+ priv = JS_GetPrivate(obj);
if (priv == NULL)
return;
cairo_pattern_destroy(priv->pattern);
@@ -114,7 +114,7 @@ gjs_cairo_pattern_construct(JSContext *context,
priv = g_slice_new0(GjsCairoPattern);
g_assert(priv_from_js(context, object) == NULL);
- JS_SetPrivate(context, object, priv);
+ JS_SetPrivate(object, priv);
priv->context = context;
priv->object = object;
@@ -196,7 +196,7 @@ gjs_cairo_pattern_get_pattern(JSContext *context,
g_return_val_if_fail(context != NULL, NULL);
g_return_val_if_fail(object != NULL, NULL);
- priv = JS_GetPrivate(context, object);
+ priv = JS_GetPrivate(object);
if (priv == NULL)
return NULL;
diff --git a/modules/cairo-surface.c b/modules/cairo-surface.c
index 1d372dfd..5926930b 100644
--- a/modules/cairo-surface.c
+++ b/modules/cairo-surface.c
@@ -42,7 +42,7 @@ gjs_cairo_surface_finalize(JSContext *context,
JSObject *obj)
{
GjsCairoSurface *priv;
- priv = JS_GetPrivate(context, obj);
+ priv = JS_GetPrivate(obj);
if (priv == NULL)
return;
cairo_surface_destroy(priv->surface);
@@ -152,7 +152,7 @@ gjs_cairo_surface_construct(JSContext *context,
priv = g_slice_new0(GjsCairoSurface);
g_assert(priv_from_js(context, object) == NULL);
- JS_SetPrivate(context, object, priv);
+ JS_SetPrivate(object, priv);
priv->context = context;
priv->object = object;
@@ -237,7 +237,7 @@ gjs_cairo_surface_get_surface(JSContext *context,
g_return_val_if_fail(context != NULL, NULL);
g_return_val_if_fail(object != NULL, NULL);
- priv = JS_GetPrivate(context, object);
+ priv = JS_GetPrivate(object);
if (priv == NULL)
return NULL;
return priv->surface;