Hello community, here is the log from the commit of package gjs for openSUSE:Factory checked in at 2013-07-16 14:57:15 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/gjs (Old) and /work/SRC/openSUSE:Factory/.gjs.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "gjs" Changes: -------- --- /work/SRC/openSUSE:Factory/gjs/gjs.changes 2013-06-29 19:39:42.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.gjs.new/gjs.changes 2013-07-16 14:57:17.000000000 +0200 @@ -1,0 +2,6 @@ +Wed Jul 10 17:39:54 UTC 2013 - [email protected] + +- Update to version 1.37.4: + + Bugs fixed: bgo#701196, bgo#701525, bgo#703068, bgo#703564. + +------------------------------------------------------------------- Old: ---- gjs-1.37.1.tar.xz New: ---- gjs-1.37.4.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ gjs.spec ++++++ --- /var/tmp/diff_new_pack.wtG1O0/_old 2013-07-16 14:57:18.000000000 +0200 +++ /var/tmp/diff_new_pack.wtG1O0/_new 2013-07-16 14:57:18.000000000 +0200 @@ -17,7 +17,7 @@ Name: gjs -Version: 1.37.1 +Version: 1.37.4 Release: 0 # FIXME: find out if tapsets should really be in devel package or in main package Summary: JavaScript bindings based on gobject-introspection and Mozilla @@ -32,7 +32,7 @@ BuildRequires: pkgconfig(cairo) BuildRequires: pkgconfig(dbus-glib-1) BuildRequires: pkgconfig(glib-2.0) >= 2.36.0 -BuildRequires: pkgconfig(gobject-introspection-1.0) >= 1.36.0 +BuildRequires: pkgconfig(gobject-introspection-1.0) >= 1.37.1 BuildRequires: pkgconfig(libffi) BuildRequires: pkgconfig(mozjs-17.0) Requires: libgjs0 = %{version} ++++++ gjs-1.37.1.tar.xz -> gjs-1.37.4.tar.xz ++++++ ++++ 2185 lines of diff (skipped) ++++ retrying with extended exclude list diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/gjs-1.37.1/INSTALL new/gjs-1.37.4/INSTALL --- old/gjs-1.37.1/INSTALL 2013-05-28 21:00:36.000000000 +0200 +++ new/gjs-1.37.4/INSTALL 2013-07-10 18:47:58.000000000 +0200 @@ -1,7 +1,7 @@ Installation Instructions ************************* -Copyright (C) 1994-1996, 1999-2002, 2004-2012 Free Software Foundation, +Copyright (C) 1994-1996, 1999-2002, 2004-2013 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/gjs-1.37.1/Makefile.am new/gjs-1.37.4/Makefile.am --- old/gjs-1.37.1/Makefile.am 2013-05-28 20:58:55.000000000 +0200 +++ new/gjs-1.37.4/Makefile.am 2013-07-10 18:13:33.000000000 +0200 @@ -62,6 +62,7 @@ gjs/profiler.h \ gi/proxyutils.h \ util/crash.h \ + util/hash-x32.h \ util/error.h \ util/glib.h \ util/log.h \ @@ -121,6 +122,7 @@ modules/modules.c \ modules/modules.h \ util/error.c \ + util/hash-x32.c \ util/glib.c \ util/crash.c \ util/log.c \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/gjs-1.37.1/configure.ac new/gjs-1.37.4/configure.ac --- old/gjs-1.37.1/configure.ac 2013-05-28 21:00:00.000000000 +0200 +++ new/gjs-1.37.4/configure.ac 2013-07-10 18:42:11.000000000 +0200 @@ -3,7 +3,7 @@ m4_define(pkg_major_version, 1) m4_define(pkg_minor_version, 37) -m4_define(pkg_micro_version, 1) +m4_define(pkg_micro_version, 4) m4_define(pkg_version, pkg_major_version.pkg_minor_version.pkg_micro_version) m4_define(pkg_int_version, (pkg_major_version * 100 + pkg_minor_version) * 100 + pkg_micro_version) @@ -95,7 +95,7 @@ fi CFLAGS="$save_CFLAGS" -GOBJECT_INTROSPECTION_REQUIRE([1.36.0]) +GOBJECT_INTROSPECTION_REQUIRE([1.37.1]) common_packages="gmodule-2.0 gthread-2.0 gio-2.0 >= glib_required_version mozjs-17.0" gjs_packages="gobject-introspection-1.0 libffi $common_packages" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/gjs-1.37.1/gi/function.c new/gjs-1.37.4/gi/function.c --- old/gjs-1.37.1/gi/function.c 2013-05-28 20:58:55.000000000 +0200 +++ new/gjs-1.37.4/gi/function.c 2013-07-10 18:13:33.000000000 +0200 @@ -1629,9 +1629,7 @@ function = function_new(context, gtype, info); if (function == NULL) { gjs_move_exception(context, context); - - JS_EndRequest(context); - return NULL; + goto out; } if (info_type == GI_INFO_TYPE_FUNCTION) { @@ -1649,14 +1647,13 @@ NULL, NULL, GJS_MODULE_PROP_FLAGS)) { gjs_debug(GJS_DEBUG_GFUNCTION, "Failed to define function"); - - JS_EndRequest(context); - return NULL; + function = NULL; } if (free_name) g_free(name); + out: JS_EndRequest(context); return function; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/gjs-1.37.1/gi/gtype.c new/gjs-1.37.4/gi/gtype.c --- old/gjs-1.37.1/gi/gtype.c 2013-05-28 20:58:55.000000000 +0200 +++ new/gjs-1.37.4/gi/gtype.c 2013-07-10 18:13:33.000000000 +0200 @@ -192,3 +192,11 @@ return _gjs_gtype_get_actual_gtype(context, object, 2); } + +JSBool +gjs_typecheck_gtype (JSContext *context, + JSObject *obj, + JSBool throw) +{ + return do_base_typecheck(context, obj, throw); +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/gjs-1.37.1/gi/gtype.h new/gjs-1.37.4/gi/gtype.h --- old/gjs-1.37.1/gi/gtype.h 2013-05-28 20:58:55.000000000 +0200 +++ new/gjs-1.37.4/gi/gtype.h 2013-07-10 18:13:33.000000000 +0200 @@ -42,6 +42,9 @@ GType gjs_gtype_get_actual_gtype (JSContext *context, JSObject *object); +JSBool gjs_typecheck_gtype (JSContext *context, + JSObject *obj, + JSBool throw); G_END_DECLS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/gjs-1.37.1/gi/keep-alive.c new/gjs-1.37.4/gi/keep-alive.c --- old/gjs-1.37.1/gi/keep-alive.c 2013-05-28 20:58:55.000000000 +0200 +++ new/gjs-1.37.4/gi/keep-alive.c 2013-07-10 18:13:33.000000000 +0200 @@ -179,7 +179,7 @@ gjs_keep_alive_new(JSContext *context) { KeepAlive *priv; - JSObject *keep_alive; + JSObject *keep_alive = NULL; JSObject *global; JSBool found; @@ -198,7 +198,8 @@ g_assert(global != NULL); if (!JS_HasProperty(context, global, gjs_keep_alive_class.name, &found)) - return JS_FALSE; + goto out; + if (!found) { JSObject *prototype; @@ -254,6 +255,7 @@ gjs_debug_lifecycle(GJS_DEBUG_KEEP_ALIVE, "keep_alive constructor, obj %p priv %p", keep_alive, priv); + out: JS_EndRequest(context); return keep_alive; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/gjs-1.37.1/gi/object.c new/gjs-1.37.4/gi/object.c --- old/gjs-1.37.1/gi/object.c 2013-05-28 20:58:55.000000000 +0200 +++ new/gjs-1.37.4/gi/object.c 2013-07-10 18:13:33.000000000 +0200 @@ -30,6 +30,7 @@ #include "gtype.h" #include "arg.h" #include "repo.h" +#include "gtype.h" #include "function.h" #include "proxyutils.h" #include "param.h" @@ -44,6 +45,7 @@ #include <gjs/runtime.h> #include <util/log.h> +#include <util/hash-x32.h> #include <girepository.h> typedef struct { @@ -86,6 +88,7 @@ }; static GSList *object_init_list; +static GHashTable *class_init_properties; static struct JSClass gjs_object_instance_class; static GThread *gjs_eval_thread; @@ -688,12 +691,11 @@ goto free_array_and_fail; while (!JSID_IS_VOID(prop_id)) { - char *name; + char *name = NULL; jsval value; GParameter gparam = { NULL, { 0, }}; if (!gjs_object_require_property(context, props, "property list", prop_id, &value)) { - g_free(name); goto free_array_and_fail; } @@ -2357,10 +2359,27 @@ gjs_object_class_init(GObjectClass *class, gpointer user_data) { + GPtrArray *properties; + GType gtype; + gint i; + + gtype = G_OBJECT_CLASS_TYPE (class); + class->set_property = gjs_object_set_gproperty; class->get_property = gjs_object_get_gproperty; gjs_eval_thread = g_thread_self(); + + properties = gjs_hash_table_for_gsize_lookup (class_init_properties, gtype); + if (properties != NULL) { + for (i = 0; i < properties->len; i++) { + GParamSpec *pspec = properties->pdata[i]; + g_param_spec_set_qdata(pspec, gjs_is_custom_property_quark(), GINT_TO_POINTER(1)); + g_object_class_install_property (class, i+1, pspec); + } + + gjs_hash_table_for_gsize_remove (class_init_properties, gtype); + } } static void @@ -2409,7 +2428,7 @@ { jsval *argv = JS_ARGV(cx, vp); gchar *name; - JSObject *parent, *constructor, *interfaces, *module; + JSObject *parent, *constructor, *interfaces, *properties, *module; GType instance_type, parent_type; GTypeQuery query; GTypeModule *type_module; @@ -2428,17 +2447,19 @@ 0, /* n_preallocs */ gjs_object_custom_init, }; - guint32 i, n_interfaces; + guint32 i, n_interfaces, n_properties; + GPtrArray *properties_native = NULL; GType *iface_types; JSBool retval = JS_FALSE; JS_BeginRequest(cx); if (!gjs_parse_args(cx, "register_type", - "oso", argc, argv, + "osoo", argc, argv, "parent", &parent, "name", &name, - "interfaces", &interfaces)) + "interfaces", &interfaces, + "properties", &properties)) goto out; if (!parent) @@ -2455,6 +2476,14 @@ if (!JS_GetArrayLength(cx, interfaces, &n_interfaces)) goto out; + if (!JS_IsArrayObject(cx, properties)) { + gjs_throw(cx, "Invalid parameter properties (expected Array)"); + goto out; + } + + if (!JS_GetArrayLength(cx, properties, &n_properties)) + goto out; + iface_types = g_alloca(sizeof(GType) * n_interfaces); /* We do interface addition in two passes so that any failure @@ -2508,6 +2537,28 @@ g_type_set_qdata (instance_type, gjs_is_custom_type_quark(), GINT_TO_POINTER (1)); + if (!class_init_properties) + class_init_properties = gjs_hash_table_new_for_gsize ((GDestroyNotify)g_ptr_array_unref); + properties_native = g_ptr_array_new_with_free_func ((GDestroyNotify)g_param_spec_unref); + for (i = 0; i < n_properties; i++) { + jsval prop_val; + JSObject *prop_obj; + + if (!JS_GetElement(cx, properties, i, &prop_val)) + goto out; + + if (!JSVAL_IS_OBJECT(prop_val)) { + gjs_throw (cx, "Invalid parameter, expected object"); + goto out; + } + prop_obj = JSVAL_TO_OBJECT(prop_val); + if (!gjs_typecheck_param(cx, prop_obj, G_TYPE_NONE, JS_TRUE)) + goto out; + g_ptr_array_add (properties_native, g_param_spec_ref (gjs_g_param_from_param (cx, prop_obj))); + } + gjs_hash_table_for_gsize_insert (class_init_properties, (gsize)instance_type, + g_ptr_array_ref (properties_native)); + for (i = 0; i < n_interfaces; i++) gjs_add_interface(instance_type, iface_types[i]); @@ -2520,56 +2571,20 @@ retval = JS_TRUE; out: + g_clear_pointer(&properties_native, g_ptr_array_unref); JS_EndRequest(cx); return retval; } static JSBool -gjs_register_property(JSContext *cx, - unsigned argc, - jsval *vp) -{ - jsval *argv = JS_ARGV(cx, vp); - JSObject *obj; - JSObject *pspec_js; - GParamSpec *pspec; - ObjectInstance *priv; - - if (argc != 2) - return JS_FALSE; - - if (!JSVAL_IS_OBJECT(argv[0]) || - !JSVAL_IS_OBJECT(argv[1])) - return JS_FALSE; - - obj = JSVAL_TO_OBJECT(argv[0]); - pspec_js = JSVAL_TO_OBJECT(argv[1]); - - if (!do_base_typecheck(cx, obj, JS_TRUE)) - return JS_FALSE; - if (!gjs_typecheck_param(cx, pspec_js, G_TYPE_NONE, JS_TRUE)) - return JS_FALSE; - - priv = priv_from_js(cx, obj); - pspec = gjs_g_param_from_param(cx, pspec_js); - - g_param_spec_set_qdata(pspec, gjs_is_custom_property_quark(), GINT_TO_POINTER(1)); - - g_object_class_install_property(G_OBJECT_CLASS (priv->klass), PROP_JS_HANDLED, pspec); - - JS_SET_RVAL(cx, vp, JSVAL_VOID); - return JS_TRUE; -} - -static JSBool gjs_signal_new(JSContext *cx, unsigned argc, jsval *vp) { jsval *argv = JS_ARGV(cx, vp); JSObject *obj; - ObjectInstance *priv; + GType gtype; gchar *signal_name = NULL; GSignalAccumulator accumulator; gint signal_id; @@ -2588,12 +2603,8 @@ } obj = JSVAL_TO_OBJECT(argv[0]); - if (!do_base_typecheck(cx, obj, JS_TRUE)) { - ret = JS_FALSE; - goto out; - } - - priv = priv_from_js(cx, obj); + if (!gjs_typecheck_gtype(cx, obj, JS_TRUE)) + return JS_FALSE; /* we only support standard accumulators for now */ switch (JSVAL_TO_INT(argv[3])) { @@ -2632,8 +2643,10 @@ params[i] = gjs_gtype_get_actual_gtype(cx, JSVAL_TO_OBJECT(gtype_val)); } + gtype = gjs_gtype_get_actual_gtype(cx, obj); + signal_id = g_signal_newv(signal_name, - priv->gtype, + gtype, JSVAL_TO_INT(argv[2]), /* signal_flags */ NULL, /* class closure */ accumulator, @@ -2660,7 +2673,7 @@ if (!JS_DefineFunction(context, module_obj, "register_type", (JSNative)gjs_register_type, - 2, GJS_MODULE_PROP_FLAGS)) + 4, GJS_MODULE_PROP_FLAGS)) return JS_FALSE; if (!JS_DefineFunction(context, module_obj, @@ -2676,12 +2689,6 @@ return JS_FALSE; if (!JS_DefineFunction(context, module_obj, - "register_property", - (JSNative)gjs_register_property, - 2, GJS_MODULE_PROP_FLAGS)) - return JS_FALSE; - - if (!JS_DefineFunction(context, module_obj, "signal_new", (JSNative)gjs_signal_new, 6, GJS_MODULE_PROP_FLAGS)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/gjs-1.37.1/gjs/context.c new/gjs-1.37.4/gjs/context.c --- old/gjs-1.37.1/gjs/context.c 2013-05-28 20:58:55.000000000 +0200 +++ new/gjs-1.37.4/gjs/context.c 2013-07-10 18:13:33.000000000 +0200 @@ -160,13 +160,14 @@ JSExceptionState *exc_state; JSString *jstr; - JS_BeginRequest(context); - if ((argc != 1 && argc != 2) || !JSVAL_IS_OBJECT (argv[0])) { gjs_throw(context, "Must pass an exception and optionally a message to logError()"); + return JS_FALSE; } + JS_BeginRequest(context); + if (argc == 2) { /* JS_ValueToString might throw, in which we will only *log that the value could be converted to string */ @@ -570,6 +571,7 @@ js_context = GJS_CONTEXT(object); js_context->runtime = JS_NewRuntime(32*1024*1024 /* max bytes */); + JS_SetNativeStackQuota(js_context->runtime, 1024*1024); if (js_context->runtime == NULL) g_error("Failed to create javascript runtime"); JS_SetGCParameter(js_context->runtime, JSGC_MAX_BYTES, 0xffffffff); @@ -591,12 +593,10 @@ */ options_flags = JSOPTION_DONT_REPORT_UNCAUGHT | JSOPTION_STRICT | JSOPTION_ALLOW_XML; -#ifdef JSOPTION_JIT if (!g_getenv("GJS_DISABLE_JIT")) { gjs_debug(GJS_DEBUG_CONTEXT, "Enabling JIT"); - options_flags |= JSOPTION_JIT; + options_flags |= JSOPTION_METHODJIT; } -#endif JS_SetOptions(js_context->context, JS_GetOptions(js_context->context) | options_flags); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/gjs-1.37.1/gjs/jsapi-util-string.c new/gjs-1.37.4/gjs/jsapi-util-string.c --- old/gjs-1.37.1/gjs/jsapi-util-string.c 2013-05-28 20:58:55.000000000 +0200 +++ new/gjs-1.37.4/gjs/jsapi-util-string.c 2013-07-10 18:13:33.000000000 +0200 @@ -248,7 +248,10 @@ const char *string) { JSString *str; - + jsid id; + JS_BeginRequest(context); str = JS_InternString(context, string); - return INTERNED_STRING_TO_JSID(context, str); + id = INTERNED_STRING_TO_JSID(context, str); + JS_EndRequest(context); + return id; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/gjs-1.37.1/gjs/jsapi-util.c new/gjs-1.37.4/gjs/jsapi-util.c --- old/gjs-1.37.1/gjs/jsapi-util.c 2013-05-28 20:58:55.000000000 +0200 +++ new/gjs-1.37.4/gjs/jsapi-util.c 2013-07-10 18:13:33.000000000 +0200 @@ -69,32 +69,11 @@ return JS_GetGlobalObject(context); } -static void -global_finalize(JSFreeOp *fop, JSObject *global) -{ - g_free(JS_GetPrivate(global)); - JS_SetPrivate(global, NULL); -} - -static void -global_trace(JSTracer *trc, JSObject *global) -{ - jsval *slots; - int i; - - slots = JS_GetPrivate(global); - - for (i = 0; i < GJS_GLOBAL_SLOT_LAST; i++) { - if (!JSVAL_IS_VOID(slots[i])) - JS_CALL_VALUE_TRACER(trc, slots[i], "global slot"); - } -} - static JSClass global_class = { - "GjsGlobal", JSCLASS_GLOBAL_FLAGS, + "GjsGlobal", JSCLASS_GLOBAL_FLAGS_WITH_SLOTS(GJS_GLOBAL_SLOT_LAST), JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub, - JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, global_finalize, - NULL /* checkAccess */, NULL /* call */, NULL /* hasInstance */, NULL /* construct */, global_trace, + JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, NULL, + NULL /* checkAccess */, NULL /* call */, NULL /* hasInstance */, NULL /* construct */, NULL, { NULL } }; @@ -111,8 +90,6 @@ gjs_init_context_standard (JSContext *context) { JSObject *global; - jsval *slots; - int i; global = JS_NewGlobalObject(context, &global_class, NULL); if (global == NULL) @@ -120,11 +97,6 @@ if (!JS_InitStandardClasses(context, global)) return FALSE; - slots = g_new(jsval, GJS_GLOBAL_SLOT_LAST); - for (i = 0; i < GJS_GLOBAL_SLOT_LAST; i++) - slots[i] = JSVAL_VOID; - - JS_SetPrivate(global, slots); return TRUE; } @@ -134,11 +106,8 @@ jsval value) { JSObject *global; - jsval *slots; - global = JS_GetGlobalObject(context); - slots = JS_GetPrivate(global); - slots[slot] = value; + JS_SetReservedSlot(global, JSCLASS_GLOBAL_SLOT_COUNT + slot, value); } jsval @@ -146,11 +115,8 @@ GjsGlobalSlot slot) { JSObject *global; - jsval *slots; - global = JS_GetGlobalObject(context); - slots = JS_GetPrivate(global); - return slots[slot]; + return JS_GetReservedSlot(global, JSCLASS_GLOBAL_SLOT_COUNT + slot); } /* Returns whether the object had the property; if the object did @@ -547,6 +513,8 @@ g_free(utf8_message); g_free(utf8_stack); + JS_EndRequest(context); + return JS_TRUE; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/gjs-1.37.1/installed-tests/jsunit.test.in new/gjs-1.37.4/installed-tests/jsunit.test.in --- old/gjs-1.37.1/installed-tests/jsunit.test.in 2013-05-28 20:58:55.000000000 +0200 +++ new/gjs-1.37.4/installed-tests/jsunit.test.in 2013-07-10 18:13:33.000000000 +0200 @@ -1,2 +1,3 @@ [Test] +Type=session Exec=@pkglibexecdir@/installed-tests/jsunit diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/gjs-1.37.1/modules/overrides/GObject.js new/gjs-1.37.4/modules/overrides/GObject.js --- old/gjs-1.37.1/modules/overrides/GObject.js 2013-05-28 20:58:55.000000000 +0200 +++ new/gjs-1.37.4/modules/overrides/GObject.js 2013-07-10 18:13:33.000000000 +0200 @@ -28,23 +28,13 @@ Name: 'GObjectClass', Extends: Lang.Class, - _init: function(params) { - // retrieve all parameters and remove them from params before chaining - - let properties = params.Properties; - let signals = params.Signals; - - delete params.Properties; + _init: function (params) { + // retrieve signals and remove them from params before chaining + let signals = params.Signals; delete params.Signals; this.parent(params); - if (properties) { - for (let prop in properties) { - Gi.register_property(this.prototype, properties[prop]); - } - } - if (signals) { for (let signalName in signals) { let obj = signals[signalName]; @@ -54,7 +44,7 @@ let paramtypes = (obj.param_types !== undefined) ? obj.param_types : []; try { - obj.signal_id = Gi.signal_new(this.prototype, signalName, flags, accumulator, rtype, paramtypes); + obj.signal_id = Gi.signal_new(this.$gtype, signalName, flags, accumulator, rtype, paramtypes); } catch(e) { throw new TypeError('Invalid signal ' + signalName + ': ' + e.message); } @@ -115,9 +105,17 @@ throw new TypeError('GObject.Class used with invalid base class (is ' + parent + ')'); let interfaces = params.Implements || []; + let properties = params.Properties; delete params.Implements; + delete params.Properties; - let newClass = Gi.register_type(parent.prototype, gtypename, interfaces); + let propertiesArray = []; + if (properties) { + for (let prop in properties) { + propertiesArray.push(properties[prop]); + } + } + let newClass = Gi.register_type(parent.prototype, gtypename, interfaces, propertiesArray); // See Class.prototype._construct in lang.js for the reasoning // behind this direct __proto__ set. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/gjs-1.37.1/util/hash-x32.c new/gjs-1.37.4/util/hash-x32.c --- old/gjs-1.37.1/util/hash-x32.c 1970-01-01 01:00:00.000000000 +0100 +++ new/gjs-1.37.4/util/hash-x32.c 2013-07-10 18:13:33.000000000 +0200 @@ -0,0 +1,69 @@ +/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */ +/* + * Copyright (c) 2013 Red Hat, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +#include "hash-x32.h" + +/* Note: Not actually tested on x32 */ + +#define HASH_GSIZE_FITS_POINTER (sizeof(gsize) == sizeof(gpointer)) + +GHashTable * +gjs_hash_table_new_for_gsize (GDestroyNotify value_destroy) +{ + if (HASH_GSIZE_FITS_POINTER) { + return g_hash_table_new_full (NULL, NULL, NULL, value_destroy); + } else { + return g_hash_table_new_full (g_int64_hash, g_int64_equal, g_free, value_destroy); + } +} + +void +gjs_hash_table_for_gsize_insert (GHashTable *table, gsize key, gpointer value) +{ + if (HASH_GSIZE_FITS_POINTER) { + g_hash_table_insert (table, (gpointer)key, value); + } else { + guint64 *keycopy = g_new (guint64, 1); + *keycopy = (guint64) key; + g_hash_table_insert (table, keycopy, value); + } +} + +void +gjs_hash_table_for_gsize_remove (GHashTable *table, gsize key) +{ + if (HASH_GSIZE_FITS_POINTER) + g_hash_table_remove (table, (gpointer)key); + else + g_hash_table_remove (table, &key); +} + +gpointer +gjs_hash_table_for_gsize_lookup (GHashTable *table, gsize key) +{ + if (HASH_GSIZE_FITS_POINTER) + return g_hash_table_lookup (table, (gpointer)key); + else + return g_hash_table_lookup (table, &key); +} + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/gjs-1.37.1/util/hash-x32.h new/gjs-1.37.4/util/hash-x32.h --- old/gjs-1.37.1/util/hash-x32.h 1970-01-01 01:00:00.000000000 +0100 +++ new/gjs-1.37.4/util/hash-x32.h 2013-07-10 18:13:33.000000000 +0200 @@ -0,0 +1,42 @@ +/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */ +/* + * Copyright (c) 2013 Red Hat, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ +#ifndef __GJS_UTIL_HASH_X32_H__ +#define __GJS_UTIL_HASH_X32_H__ + +#include <glib.h> + +G_BEGIN_DECLS + +/* Hash table that operates on gsize; on every architecture except x32, + * sizeof(gsize) == sizeof(gpointer), and so we can just use it as a + * hash key directly. But on x32, we have to fall back to malloc(). + */ + +GHashTable *gjs_hash_table_new_for_gsize (GDestroyNotify value_destroy); +void gjs_hash_table_for_gsize_insert (GHashTable *table, gsize key, gpointer value); +void gjs_hash_table_for_gsize_remove (GHashTable *table, gsize key); +gpointer gjs_hash_table_for_gsize_lookup (GHashTable *table, gsize key); + +G_END_DECLS + +#endif -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
