summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Lunn <tim@feathertop.org>2013-01-03 13:51:26 +1100
committerRico Tzschichholz <ricotz@ubuntu.com>2013-03-24 14:28:35 +0100
commitae430f1c5f9ebdc5a8021d3f6a0b83702c111fe4 (patch)
tree65b486943369886ff6ec17fdbcb43810e34d1cab
parente349c114ed0337d60d18b824c98a16d40d421644 (diff)
downloadgjs-ae430f1c5f9ebdc5a8021d3f6a0b83702c111fe4.tar.gz
JS_GetClass remove context argument
JS_GetClass no longer takes *context as first argument, consequently the JS_GET_CLASS Macro is also removed. https://bugzilla.gnome.org/show_bug.cgi?id=690982
-rw-r--r--gi/boxed.c8
-rw-r--r--gi/gerror.c6
-rw-r--r--gi/object.c4
-rw-r--r--gi/param.c4
-rw-r--r--gi/union.c6
-rw-r--r--gjs/jsapi-dynamic-class.c2
-rw-r--r--gjs/jsapi-util.c9
-rw-r--r--gjs/stack.c2
8 files changed, 19 insertions, 22 deletions
diff --git a/gi/boxed.c b/gi/boxed.c
index f46cec5d..bbea2c7a 100644
--- a/gi/boxed.c
+++ b/gi/boxed.c
@@ -598,7 +598,7 @@ get_nested_interface_object (JSContext *context,
offset = g_field_info_get_offset (field_info);
obj = JS_NewObjectWithGivenProto(context,
- JS_GET_CLASS(context, proto), proto,
+ JS_GetClass(proto), proto,
gjs_get_import_global (context));
if (obj == NULL)
@@ -1001,7 +1001,7 @@ gjs_lookup_boxed_class(JSContext *context,
prototype = gjs_lookup_boxed_prototype(context, info);
- return JS_GET_CLASS(context, prototype);
+ return JS_GetClass(prototype);
}
static gboolean
@@ -1242,7 +1242,7 @@ gjs_define_boxed_class(JSContext *context,
JS_SetPrivate(context, prototype, priv);
gjs_debug(GJS_DEBUG_GBOXED, "Defined class %s prototype is %p class %p in object %p",
- constructor_name, prototype, JS_GET_CLASS(context, prototype), in_object);
+ constructor_name, prototype, JS_GetClass(prototype), in_object);
priv->can_allocate_directly = struct_is_simple (priv->info);
@@ -1284,7 +1284,7 @@ gjs_boxed_from_c_struct(JSContext *context,
proto_priv = priv_from_js(context, proto);
obj = JS_NewObjectWithGivenProto(context,
- JS_GET_CLASS(context, proto), proto,
+ JS_GetClass(proto), proto,
gjs_get_import_global (context));
GJS_INC_COUNTER(boxed);
diff --git a/gi/gerror.c b/gi/gerror.c
index ad75721d..ea36b181 100644
--- a/gi/gerror.c
+++ b/gi/gerror.c
@@ -380,7 +380,7 @@ gjs_lookup_error_class(JSContext *context,
prototype = gjs_lookup_error_prototype(context, info);
- return JS_GET_CLASS(context, prototype);
+ return JS_GetClass(prototype);
}
JSBool
@@ -463,7 +463,7 @@ gjs_define_error_class(JSContext *context,
JS_SetPrivate(context, prototype, priv);
gjs_debug(GJS_DEBUG_GBOXED, "Defined class %s prototype is %p class %p in object %p",
- constructor_name, prototype, JS_GET_CLASS(context, prototype), in_object);
+ constructor_name, prototype, JS_GetClass(prototype), in_object);
gjs_define_enum_values(context, constructor, priv->info);
@@ -590,7 +590,7 @@ gjs_error_from_gerror(JSContext *context,
proto_priv = priv_from_js(context, proto);
obj = JS_NewObjectWithGivenProto(context,
- JS_GET_CLASS(context, proto), proto,
+ JS_GetClass(proto), proto,
gjs_get_import_global (context));
GJS_INC_COUNTER(gerror);
diff --git a/gi/object.c b/gi/object.c
index bfb3a3c5..dab446ef 100644
--- a/gi/object.c
+++ b/gi/object.c
@@ -1692,7 +1692,7 @@ gjs_define_object_class(JSContext *context,
JS_SetPrivate(context, prototype, priv);
gjs_debug(GJS_DEBUG_GOBJECT, "Defined class %s prototype %p class %p in object %p",
- constructor_name, prototype, JS_GET_CLASS(context, prototype), in_object);
+ constructor_name, prototype, JS_GetClass(prototype), in_object);
if (info)
gjs_define_static_methods(context, constructor, gtype, info);
@@ -1753,7 +1753,7 @@ gjs_object_from_g_object(JSContext *context,
JS_BeginRequest(context);
obj = JS_NewObjectWithGivenProto(context,
- JS_GET_CLASS(context, proto), proto,
+ JS_GetClass(proto), proto,
gjs_get_import_global (context));
JS_EndRequest(context);
diff --git a/gi/param.c b/gi/param.c
index c8594d86..8e6d67d5 100644
--- a/gi/param.c
+++ b/gi/param.c
@@ -536,7 +536,7 @@ gjs_define_param_class(JSContext *context,
*prototype_p = prototype;
gjs_debug(GJS_DEBUG_GPARAM, "Defined class %s prototype is %p class %p in object %p",
- constructor_name, prototype, JS_GET_CLASS(context, prototype), in_object);
+ constructor_name, prototype, JS_GetClass(prototype), in_object);
return JS_TRUE;
}
@@ -561,7 +561,7 @@ gjs_param_from_g_param(JSContext *context,
proto = gjs_lookup_param_prototype(context);
obj = JS_NewObjectWithGivenProto(context,
- JS_GET_CLASS(context, proto), proto,
+ JS_GetClass(proto), proto,
gjs_get_import_global (context));
GJS_INC_COUNTER(param);
diff --git a/gi/union.c b/gi/union.c
index b21c72ad..bfd7501e 100644
--- a/gi/union.c
+++ b/gi/union.c
@@ -380,7 +380,7 @@ gjs_lookup_union_class(JSContext *context,
prototype = gjs_lookup_union_prototype(context, info);
- return JS_GET_CLASS(context, prototype);
+ return JS_GetClass(prototype);
}
JSBool
@@ -463,7 +463,7 @@ gjs_define_union_class(JSContext *context,
JS_SetPrivate(context, prototype, priv);
gjs_debug(GJS_DEBUG_GBOXED, "Defined class %s prototype is %p class %p in object %p",
- constructor_name, prototype, JS_GET_CLASS(context, prototype), in_object);
+ constructor_name, prototype, JS_GetClass(prototype), in_object);
value = OBJECT_TO_JSVAL(gjs_gtype_create_gtype_wrapper(context, gtype));
JS_DefineProperty(context, constructor, "$gtype", value,
@@ -507,7 +507,7 @@ gjs_union_from_c_union(JSContext *context,
proto = gjs_lookup_union_prototype(context, (GIUnionInfo*) info);
obj = JS_NewObjectWithGivenProto(context,
- JS_GET_CLASS(context, proto), proto,
+ JS_GetClass(proto), proto,
gjs_get_import_global (context));
GJS_INC_COUNTER(boxed);
diff --git a/gjs/jsapi-dynamic-class.c b/gjs/jsapi-dynamic-class.c
index d2648d88..e0df4dca 100644
--- a/gjs/jsapi-dynamic-class.c
+++ b/gjs/jsapi-dynamic-class.c
@@ -184,7 +184,7 @@ gjs_typecheck_instance(JSContext *context,
{
if (!JS_InstanceOf(context, obj, static_clasp, NULL)) {
if (throw) {
- JSClass *obj_class = JS_GET_CLASS(context, obj);
+ JSClass *obj_class = JS_GetClass(obj);
gjs_throw_custom(context, "TypeError",
"Object %p is not a subclass of %s, it's a %s",
diff --git a/gjs/jsapi-util.c b/gjs/jsapi-util.c
index 6eab2edf..2bf38be4 100644
--- a/gjs/jsapi-util.c
+++ b/gjs/jsapi-util.c
@@ -220,7 +220,7 @@ gjs_throw_abstract_constructor_error(JSContext *context,
if (JSVAL_IS_OBJECT(callee)) {
if (gjs_object_get_property(context, JSVAL_TO_OBJECT(callee),
"prototype", &prototype)) {
- proto_class = JS_GetClass(context, JSVAL_TO_OBJECT(prototype));
+ proto_class = JS_GetClass(JSVAL_TO_OBJECT(prototype));
name = proto_class->name;
}
}
@@ -348,7 +348,7 @@ gjs_value_debug_string(JSContext *context,
*/
JSClass *klass;
- klass = JS_GET_CLASS(context, JSVAL_TO_OBJECT(value));
+ klass = JS_GetClass(JSVAL_TO_OBJECT(value));
if (klass != NULL) {
str = JS_NewStringCopyZ(context, klass->name);
JS_ClearPendingException(context);
@@ -821,13 +821,10 @@ gjs_date_from_time_t (JSContext *context, time_t time)
if (!JS_GetProperty(context, date_constructor, "prototype", &date_prototype))
gjs_fatal("Failed to get prototype from Date constructor");
- date_class = JS_GET_CLASS(context, JSVAL_TO_OBJECT (date_prototype));
-
if (!JS_NewNumberValue(context, ((double) time) * 1000, &(args[0])))
gjs_fatal("Failed to convert time_t to number");
- date = JS_ConstructObjectWithArguments(context, date_class,
- NULL, NULL, 1, args);
+ date = JS_New(context, JSVAL_TO_OBJECT (date_prototype), 1, args);
result = OBJECT_TO_JSVAL(date);
JS_LeaveLocalRootScope(context);
diff --git a/gjs/stack.c b/gjs/stack.c
index 54317d63..aec76ed4 100644
--- a/gjs/stack.c
+++ b/gjs/stack.c
@@ -68,7 +68,7 @@ jsvalue_to_string(JSContext* cx, jsval val, gboolean* is_string)
if (!value_str)
value = g_strdup("[unknown function]");
} else {
- value = g_strdup_printf("[object %s]", JS_GetClass(cx, obj)->name);
+ value = g_strdup_printf("[object %s]", JS_GetClass(obj)->name);
}
}