Conditionally silence JavaScriptCore deprecation warning
This commit is contained in:
parent
4670a9ca2e
commit
7ac9c7787b
1 changed files with 13 additions and 3 deletions
14
midori/gjs.c
14
midori/gjs.c
|
@ -13,6 +13,8 @@
|
||||||
|
|
||||||
#include <gmodule.h>
|
#include <gmodule.h>
|
||||||
#include <glib/gi18n.h>
|
#include <glib/gi18n.h>
|
||||||
|
/* Needed for versioning macros */
|
||||||
|
#include <webkit/webkit.h>
|
||||||
|
|
||||||
struct _GjsValue
|
struct _GjsValue
|
||||||
{
|
{
|
||||||
|
@ -727,7 +729,8 @@ _js_class_get_property_cb (JSContextRef js_context,
|
||||||
js_class_def.className = g_strdup (property);
|
js_class_def.className = g_strdup (property);
|
||||||
js_class_def.callAsFunction = _js_object_call_as_function_cb;
|
js_class_def.callAsFunction = _js_object_call_as_function_cb;
|
||||||
JSClassRef js_class = JSClassCreate (&js_class_def);
|
JSClassRef js_class = JSClassCreate (&js_class_def);
|
||||||
JSObjectRef js_function = JSObjectMake (js_context, js_class, property);
|
JSObjectRef js_function = JSObjectMake (js_context,
|
||||||
|
js_class, property);
|
||||||
return js_function;
|
return js_function;
|
||||||
}
|
}
|
||||||
g_free (property);
|
g_free (property);
|
||||||
|
@ -1011,14 +1014,21 @@ gjs_module_new (JSContextRef js_context,
|
||||||
js_class_def.hasProperty = _js_module_has_property_cb;
|
js_class_def.hasProperty = _js_module_has_property_cb;
|
||||||
js_class_def.getProperty = _js_module_get_property_cb;
|
js_class_def.getProperty = _js_module_get_property_cb;
|
||||||
JSClassRef js_class = JSClassCreate (&js_class_def);
|
JSClassRef js_class = JSClassCreate (&js_class_def);
|
||||||
JSObjectRef js_module = JSObjectMake (js_context, js_class, (gpointer)namespace);
|
JSObjectRef js_module = JSObjectMake (js_context, js_class,
|
||||||
|
(gpointer)namespace);
|
||||||
return js_module;
|
return js_module;
|
||||||
}
|
}
|
||||||
|
|
||||||
JSGlobalContextRef
|
JSGlobalContextRef
|
||||||
gjs_global_context_new (void)
|
gjs_global_context_new (void)
|
||||||
{
|
{
|
||||||
|
#ifdef WEBKIT_CHECK_VERSION
|
||||||
|
#if WEBKIT_CHECK_VERSION (1, 0, 3)
|
||||||
|
JSGlobalContextRef js_context = JSGlobalContextCreateInGroup (NULL, NULL);
|
||||||
|
#else
|
||||||
JSGlobalContextRef js_context = JSGlobalContextCreate (NULL);
|
JSGlobalContextRef js_context = JSGlobalContextCreate (NULL);
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
JSObjectRef js_object = gjs_object_new (js_context, "GJS", NULL);
|
JSObjectRef js_object = gjs_object_new (js_context, "GJS", NULL);
|
||||||
_js_object_set_property (js_context, JSContextGetGlobalObject (js_context),
|
_js_object_set_property (js_context, JSContextGetGlobalObject (js_context),
|
||||||
"gjs", js_object);
|
"gjs", js_object);
|
||||||
|
|
Loading…
Reference in a new issue