1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-09-28 03:06:20 -04:00

keymap_set_property: xulrunner-2.0 fix

In keymap_set_property, convert the jsid value into a jsval value before
calling JS_ValueToString on it.
This commit is contained in:
Miciah Dashiel Butler Masters 2011-10-27 21:25:30 +00:00
parent 0189b6bfc9
commit bdeace4811

View File

@ -74,6 +74,7 @@ keymap_set_property(JSContext *ctx, JSObject *obj, jsid id, JSBool strict, jsval
{
int *data;
unsigned char *keymap_str;
jsval val;
const unsigned char *keystroke_str;
/* This can be called if @obj if not itself an instance of the
@ -90,7 +91,8 @@ keymap_set_property(JSContext *ctx, JSObject *obj, jsid id, JSBool strict, jsval
keymap_str = get_keymap_name((enum keymap_id) *data);
if (!keymap_str) return JS_FALSE;
keystroke_str = JS_EncodeString(ctx, JS_ValueToString(ctx, id));
JS_IdToValue(ctx, id, &val);
keystroke_str = JS_EncodeString(ctx, JS_ValueToString(ctx, val));
if (!keystroke_str) return JS_FALSE;
if (JSVAL_IS_STRING(*vp)) {