1 |
axs 12/06/28 17:05:31 |
2 |
|
3 |
Added: elinks-0.12_pre5-sm185-jsval-fixes.patch |
4 |
Log: |
5 |
fixed some spidermonkey-1.8.5 jsval usage errors, added support for spidermonkey-1.8.7 |
6 |
|
7 |
(Portage version: 2.1.10.65/cvs/Linux x86_64) |
8 |
|
9 |
Revision Changes Path |
10 |
1.1 www-client/elinks/files/elinks-0.12_pre5-sm185-jsval-fixes.patch |
11 |
|
12 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/elinks/files/elinks-0.12_pre5-sm185-jsval-fixes.patch?rev=1.1&view=markup |
13 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/elinks/files/elinks-0.12_pre5-sm185-jsval-fixes.patch?rev=1.1&content-type=text/plain |
14 |
|
15 |
Index: elinks-0.12_pre5-sm185-jsval-fixes.patch |
16 |
=================================================================== |
17 |
--- a/src/scripting/smjs/action_object.c 2012-06-28 11:46:58.000000000 -0400 |
18 |
+++ b/src/scripting/smjs/action_object.c 2012-06-28 11:52:42.000000000 -0400 |
19 |
@@ -50,7 +50,7 @@ |
20 |
assert(smjs_ctx); |
21 |
if_assert_failed return JS_FALSE; |
22 |
|
23 |
- value = JS_FALSE; |
24 |
+ value = JSVAL_FALSE; |
25 |
|
26 |
if (JS_TRUE != JS_ValueToObject(ctx, argv[-2], &fn_obj)) { |
27 |
JS_SET_RVAL(ctx, rval, value); |
28 |
@@ -76,7 +76,7 @@ |
29 |
|
30 |
do_action(hop->ses, hop->action_id, 1); |
31 |
|
32 |
- value = JS_TRUE; |
33 |
+ value = JSVAL_TRUE; |
34 |
JS_SET_RVAL(ctx, rval, value); |
35 |
|
36 |
return JS_TRUE; |
37 |
--- a/src/scripting/smjs/bookmarks.c 2012-06-28 11:57:40.000000000 -0400 |
38 |
+++ b/src/scripting/smjs/bookmarks.c 2012-06-28 12:08:20.000000000 -0400 |
39 |
@@ -250,11 +250,20 @@ |
40 |
|
41 |
/* @bookmark_folder_class.getProperty */ |
42 |
static JSBool |
43 |
+#if JS_VERSION >= 185 |
44 |
+bookmark_folder_get_property(JSContext *ctx, JSObject *obj, jsid iid, jsval *vp) |
45 |
+#else |
46 |
bookmark_folder_get_property(JSContext *ctx, JSObject *obj, jsid id, jsval *vp) |
47 |
+#endif |
48 |
{ |
49 |
struct bookmark *bookmark; |
50 |
struct bookmark *folder; |
51 |
unsigned char *title = NULL; |
52 |
+#if JS_VERSION >= 185 |
53 |
+ jsval id; |
54 |
+ if (!JS_IdToValue(ctx,iid,&id)) |
55 |
+ return JS_FALSE; |
56 |
+#endif |
57 |
|
58 |
/* This can be called if @obj if not itself an instance of the |
59 |
* appropriate class but has one in its prototype chain. Fail |
60 |
--- a/src/scripting/smjs/elinks_object.c 2012-06-28 12:11:15.000000000 -0400 |
61 |
+++ b/src/scripting/smjs/elinks_object.c 2012-06-28 12:14:50.000000000 -0400 |
62 |
@@ -185,7 +185,7 @@ |
63 |
method, rval)) |
64 |
return JS_FALSE; |
65 |
|
66 |
- if (JSVAL_VOID == *rval) |
67 |
+ if (JSVAL_IS_VOID(*rval)) |
68 |
return JS_FALSE; |
69 |
|
70 |
return JS_CallFunctionValue(smjs_ctx, smjs_elinks_object, |
71 |
--- a/src/scripting/smjs/globhist.c 2012-06-28 12:20:25.000000000 -0400 |
72 |
+++ b/src/scripting/smjs/globhist.c 2012-06-28 12:20:15.000000000 -0400 |
73 |
@@ -201,11 +201,20 @@ |
74 |
|
75 |
/* @smjs_globhist_class.getProperty */ |
76 |
static JSBool |
77 |
-smjs_globhist_get_property(JSContext *ctx, JSObject *obj, jsid id, jsval *vp) |
78 |
+#if JS_VERSION >= 185 |
79 |
+smjs_globhist_get_property(JSContext *ctx, JSObject *obj, jsid iid, jsval *vp) |
80 |
+#else |
81 |
+smjs_globhist_get_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp) |
82 |
+#endif |
83 |
{ |
84 |
JSObject *jsobj; |
85 |
unsigned char *uri_string; |
86 |
struct global_history_item *history_item; |
87 |
+#if JS_VERSION >= 185 |
88 |
+ jsval id; |
89 |
+ if (!JS_IdToValue(ctx,iid,&id)) |
90 |
+ return JS_FALSE; |
91 |
+#endif |
92 |
|
93 |
uri_string = JS_EncodeString(ctx, JS_ValueToString(ctx, id)); |
94 |
if (!uri_string) goto ret_null; |
95 |
--- a/src/scripting/smjs/keybinding.c 2012-06-28 12:21:39.000000000 -0400 |
96 |
+++ b/src/scripting/smjs/keybinding.c.new 2012-06-28 12:48:00.000000000 -0400 |
97 |
@@ -17,11 +17,20 @@ |
98 |
|
99 |
/* @keymap_class.getProperty */ |
100 |
static JSBool |
101 |
-keymap_get_property(JSContext *ctx, JSObject *obj, jsid id, jsval *vp) |
102 |
+#if JS_VERSION >= 185 |
103 |
+keymap_get_property(JSContext *ctx, JSObject *obj, jsid iid, jsval *vp) |
104 |
+#else |
105 |
+keymap_get_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp) |
106 |
+#endif |
107 |
{ |
108 |
unsigned char *action_str; |
109 |
const unsigned char *keystroke_str; |
110 |
int *data; |
111 |
+#if JS_VERSION >= 185 |
112 |
+ jsval id; |
113 |
+ if (!JS_IdToValue(ctx,iid,&id)) |
114 |
+ return JS_FALSE; |
115 |
+#endif |
116 |
|
117 |
/* This can be called if @obj if not itself an instance of the |
118 |
* appropriate class but has one in its prototype chain. Fail |
119 |
@@ -70,11 +79,20 @@ |
120 |
|
121 |
/* @keymap_class.setProperty */ |
122 |
static JSBool |
123 |
-keymap_set_property(JSContext *ctx, JSObject *obj, jsid id, JSBool strict, jsval *vp) |
124 |
+#if JS_VERSION >= 185 |
125 |
+keymap_set_property(JSContext *ctx, JSObject *obj, jsid iid, JSBool strict, jsval *vp) |
126 |
+#else |
127 |
+keymap_set_property(JSContext *ctx, JSObject *obj, jsval id, JSBool strict, jsval *vp) |
128 |
+#endif |
129 |
{ |
130 |
int *data; |
131 |
unsigned char *keymap_str; |
132 |
const unsigned char *keystroke_str; |
133 |
+#if JS_VERSION >= 185 |
134 |
+ jsval id; |
135 |
+ if (!JS_IdToValue(ctx,iid,&id)) |
136 |
+ return JS_FALSE; |
137 |
+#endif |
138 |
|
139 |
/* This can be called if @obj if not itself an instance of the |
140 |
* appropriate class but has one in its prototype chain. Fail |