]>
Commit | Line | Data |
---|---|---|
90b603ad MB |
1 | From 0f886dc29b268ad0683e1372a80044a40a981192 Mon Sep 17 00:00:00 2001 |
2 | From: Marc-Antoine Perennou <Marc-Antoine@Perennou.com> | |
3 | Date: Fri, 01 Apr 2011 18:55:43 +0000 | |
4 | Subject: Conditionally adapt to JS_CLASS_TRACE removal | |
5 | ||
6 | Upstream removed it in http://hg.mozilla.org/mozilla-central/rev/a7784d11c59b | |
7 | ||
8 | https://bugzilla.gnome.org/show_bug.cgi?id=646471 | |
9 | --- | |
10 | diff --git a/configure.ac b/configure.ac | |
11 | index 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 | |
29 | diff --git a/gi/keep-alive.c b/gi/keep-alive.c | |
30 | index 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 | -- | |
59 | cgit v0.9 | |
60 | From 82a074e48610cafba0c4061b8267cccaada6be5e Mon Sep 17 00:00:00 2001 | |
61 | From: Marc-Antoine Perennou <Marc-Antoine@Perennou.com> | |
62 | Date: Fri, 01 Apr 2011 19:04:57 +0000 | |
63 | Subject: Conditionally adapt to JS_DestroyScript removal | |
64 | ||
65 | Upstream changed the behaviour of several things about JSScripts in | |
66 | http://hg.mozilla.org/mozilla-central/rev/c919a7271ac1 | |
67 | ||
68 | We now have to use a JSObject instead of a JSScript in certain circumstances, | |
69 | and we no longer have to call JS_DestroyScript which no longer exists | |
70 | ||
71 | https://bugzilla.gnome.org/show_bug.cgi?id=646471 | |
72 | --- | |
73 | diff --git a/configure.ac b/configure.ac | |
74 | index 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 | |
85 | diff --git a/modules/console.c b/modules/console.c | |
86 | index 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 | -- | |
113 | cgit v0.9 | |
114 | From 03efd168d1bfc3d3b07b26fda2c2464456df3054 Mon Sep 17 00:00:00 2001 | |
115 | From: Marc-Antoine Perennou <Marc-Antoine@Perennou.com> | |
116 | Date: Thu, 28 Apr 2011 23:01:03 +0000 | |
117 | Subject: conditonally adapt to JS_BufferIsCompilableUnit changes | |
118 | ||
119 | Upstream added an argument to JS_BufferIsCompilableUnit in commit | |
120 | http://hg.mozilla.org/mozilla-central/rev/a773890b676f | |
121 | We now have to tell if the bytes are utf8 or not. | |
122 | ||
123 | https://bugzilla.gnome.org/show_bug.cgi?id=646471 | |
124 | --- | |
125 | diff --git a/configure.ac b/configure.ac | |
126 | index 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 | |
137 | diff --git a/modules/console.c b/modules/console.c | |
138 | index 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 | -- | |
154 | cgit v0.9 |