]> git.pld-linux.org Git - packages/gjs.git/blame - gjs-xulrunner-5.0.patch
- obsolete
[packages/gjs.git] / gjs-xulrunner-5.0.patch
CommitLineData
90b603ad
MB
1From 0f886dc29b268ad0683e1372a80044a40a981192 Mon Sep 17 00:00:00 2001
2From: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
3Date: Fri, 01 Apr 2011 18:55:43 +0000
4Subject: Conditionally adapt to JS_CLASS_TRACE removal
5
6Upstream removed it in http://hg.mozilla.org/mozilla-central/rev/a7784d11c59b
7
8https://bugzilla.gnome.org/show_bug.cgi?id=646471
9---
10diff --git a/configure.ac b/configure.ac
11index d185ba1..1c773c0 100644
12--- a/configure.ac
13+++ b/configure.ac
14@@ -155,11 +155,14 @@ else
15 AC_MSG_ERROR([$JS_PACKAGE >= 1.9.2 is required])
16 fi
17
18+dnl xulrunner 2 checks
19 AC_CHECK_LIB([mozjs], [JS_GetStringBytes], AC_DEFINE([HAVE_JS_GETSTRINGBYTES], [1], [Define if we still have JS_GetStringBytes]),, [$JS_LIBS])
20 AC_CHECK_LIB([mozjs], [JS_GetFunctionName], AC_DEFINE([HAVE_JS_GETFUNCTIONNAME], [1], [Define if we still have JS_GetFunctionName]),, [$JS_LIBS])
21 AC_CHECK_LIB([mozjs], [JS_GetStringChars], AC_DEFINE([HAVE_JS_GETSTRINGCHARS], [1], [Define if we still have JS_GetStringChars]),, [$JS_LIBS])
22 AC_CHECK_LIB([mozjs], [JS_StrictPropertyStub], AC_DEFINE([HAVE_JS_STRICTPROPERTYSTUB], [1], [Define if we have JS_StrictPropertyStub]),, [$JS_LIBS])
23 AC_CHECK_LIB([mozjs], [JS_GetGlobalForScopeChain], AC_DEFINE([HAVE_JS_GETGLOBALFORSCOPECHAIN], [1], [Define if we have JS_GetGlobalForScopeChain]),, [$JS_LIBS])
24+dnl xulrunner 2.2 checks
25+AC_CHECK_LIB([mozjs], [JS_CLASS_TRACE], AC_DEFINE([HAVE_JS_CLASS_TRACE], [1], [Define if we still have JS_CLASS_TRACE]),, [$JS_LIBS])
26
27 AC_MSG_CHECKING([for mozilla-js >= 2 ])
28 if `$PKG_CONFIG --exists $JS_PACKAGE '>=' 2`; then
29diff --git a/gi/keep-alive.c b/gi/keep-alive.c
30index c7149ac..e268eaf 100644
31--- a/gi/keep-alive.c
32+++ b/gi/keep-alive.c
33@@ -184,8 +184,10 @@ keep_alive_trace(JSTracer *tracer,
34 */
35 static struct JSClass gjs_keep_alive_class = {
36 "__private_GjsKeepAlive", /* means "new __private_GjsKeepAlive()" works */
37- JSCLASS_HAS_PRIVATE |
38- JSCLASS_MARK_IS_TRACE, /* TraceOp not MarkOp */
39+#ifdef HAVE_JS_CLASS_TRACE
40+ JSCLASS_MARK_IS_TRACE | /* TraceOp not MarkOp */
41+#endif
42+ JSCLASS_HAS_PRIVATE,
43 JS_PropertyStub,
44 JS_PropertyStub,
45 JS_PropertyStub,
46@@ -200,7 +202,11 @@ static struct JSClass gjs_keep_alive_class = {
47 NULL,
48 NULL,
49 NULL,
50+#ifdef HAVE_JS_CLASS_TRACE
51 JS_CLASS_TRACE(keep_alive_trace),
52+#else
53+ keep_alive_trace,
54+#endif
55 NULL
56 };
57
58--
59cgit v0.9
60From 82a074e48610cafba0c4061b8267cccaada6be5e Mon Sep 17 00:00:00 2001
61From: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
62Date: Fri, 01 Apr 2011 19:04:57 +0000
63Subject: Conditionally adapt to JS_DestroyScript removal
64
65Upstream changed the behaviour of several things about JSScripts in
66http://hg.mozilla.org/mozilla-central/rev/c919a7271ac1
67
68We now have to use a JSObject instead of a JSScript in certain circumstances,
69and we no longer have to call JS_DestroyScript which no longer exists
70
71https://bugzilla.gnome.org/show_bug.cgi?id=646471
72---
73diff --git a/configure.ac b/configure.ac
74index 1c773c0..2e23e8e 100644
75--- a/configure.ac
76+++ b/configure.ac
77@@ -163,6 +163,7 @@ AC_CHECK_LIB([mozjs], [JS_StrictPropertyStub], AC_DEFINE([HAVE_JS_STRICTPROPERTY
78 AC_CHECK_LIB([mozjs], [JS_GetGlobalForScopeChain], AC_DEFINE([HAVE_JS_GETGLOBALFORSCOPECHAIN], [1], [Define if we have JS_GetGlobalForScopeChain]),, [$JS_LIBS])
79 dnl xulrunner 2.2 checks
80 AC_CHECK_LIB([mozjs], [JS_CLASS_TRACE], AC_DEFINE([HAVE_JS_CLASS_TRACE], [1], [Define if we still have JS_CLASS_TRACE]),, [$JS_LIBS])
81+AC_CHECK_LIB([mozjs], [JS_DestroyScript], AC_DEFINE([HAVE_JS_DESTROYSCRIPT], [1], [Define if we still have JS_DestroyScript]),, [$JS_LIBS])
82
83 AC_MSG_CHECKING([for mozilla-js >= 2 ])
84 if `$PKG_CONFIG --exists $JS_PACKAGE '>=' 2`; then
85diff --git a/modules/console.c b/modules/console.c
86index ba4b5b6..35d03c1 100644
87--- a/modules/console.c
88+++ b/modules/console.c
89@@ -161,7 +161,11 @@ gjs_console_interact(JSContext *context,
90 {
91 JSObject *object = JS_THIS_OBJECT(context, vp);
92 gboolean eof = FALSE;
93+#ifdef HAVE_JS_DESTROYSCRIPT
94 JSScript *script = NULL;
95+#else
96+ JSObject *script = NULL;
97+#endif
98 jsval result;
99 JSString *str;
100 GString *buffer = NULL;
101@@ -219,8 +223,10 @@ gjs_console_interact(JSContext *context,
102 }
103
104 next:
105+#ifdef HAVE_JS_DESTROYSCRIPT
106 if (script)
107 JS_DestroyScript(context, script);
108+#endif
109 g_string_free(buffer, TRUE);
110 } while (!eof);
111
112--
113cgit v0.9
114From 03efd168d1bfc3d3b07b26fda2c2464456df3054 Mon Sep 17 00:00:00 2001
115From: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
116Date: Thu, 28 Apr 2011 23:01:03 +0000
117Subject: conditonally adapt to JS_BufferIsCompilableUnit changes
118
119Upstream added an argument to JS_BufferIsCompilableUnit in commit
120http://hg.mozilla.org/mozilla-central/rev/a773890b676f
121We now have to tell if the bytes are utf8 or not.
122
123https://bugzilla.gnome.org/show_bug.cgi?id=646471
124---
125diff --git a/configure.ac b/configure.ac
126index 2e23e8e..6fd8fb4 100644
127--- a/configure.ac
128+++ b/configure.ac
129@@ -164,6 +164,7 @@ AC_CHECK_LIB([mozjs], [JS_GetGlobalForScopeChain], AC_DEFINE([HAVE_JS_GETGLOBALF
130 dnl xulrunner 2.2 checks
131 AC_CHECK_LIB([mozjs], [JS_CLASS_TRACE], AC_DEFINE([HAVE_JS_CLASS_TRACE], [1], [Define if we still have JS_CLASS_TRACE]),, [$JS_LIBS])
132 AC_CHECK_LIB([mozjs], [JS_DestroyScript], AC_DEFINE([HAVE_JS_DESTROYSCRIPT], [1], [Define if we still have JS_DestroyScript]),, [$JS_LIBS])
133+AC_CHECK_LIB([mozjs], [JS_DecodeUTF8], AC_DEFINE([HAVE_JS_DECODEUTF8], [1], [Define if we have JS_DecodeUTF8]),, [$JS_LIBS])
134
135 AC_MSG_CHECKING([for mozilla-js >= 2 ])
136 if `$PKG_CONFIG --exists $JS_PACKAGE '>=' 2`; then
137diff --git a/modules/console.c b/modules/console.c
138index 35d03c1..d87b4a7 100644
139--- a/modules/console.c
140+++ b/modules/console.c
141@@ -196,7 +196,11 @@ gjs_console_interact(JSContext *context,
142 g_string_append(buffer, temp_buf);
143 g_free(temp_buf);
144 lineno++;
145+#ifdef HAVE_JS_DECODEUTF8
146+ } while (!JS_BufferIsCompilableUnit(context, JS_TRUE, object, buffer->str, buffer->len));
147+#else
148 } while (!JS_BufferIsCompilableUnit(context, object, buffer->str, buffer->len));
149+#endif
150
151 script = JS_CompileScript(context, object, buffer->str, buffer->len, "typein",
152 startline);
153--
154cgit v0.9
This page took 0.036325 seconds and 4 git commands to generate.