1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

Bug 846: Document the JSClass assumed in each JS_{Set,Get}Private call.

This commit is contained in:
Kalle Olavi Niemitalo 2006-11-25 09:00:59 +02:00 committed by Kalle Olavi Niemitalo
parent 36f5f73a60
commit 356678dd80
12 changed files with 65 additions and 65 deletions

View File

@ -184,7 +184,7 @@ spidermonkey_get_interpreter(struct ecmascript_interpreter *interpreter)
JS_InitStandardClasses(ctx, window_obj);
JS_DefineProperties(ctx, window_obj, (JSPropertySpec *) window_props);
JS_DefineFunctions(ctx, window_obj, (JSFunctionSpec *) window_funcs);
JS_SetPrivate(ctx, window_obj, interpreter->vs);
JS_SetPrivate(ctx, window_obj, interpreter->vs); /* to @window_class */
document_obj = JS_InitClass(ctx, window_obj, NULL,
(JSClass *) &document_class, NULL, 0,
@ -214,13 +214,13 @@ spidermonkey_get_interpreter(struct ecmascript_interpreter *interpreter)
(JSClass *) &menubar_class, NULL, 0,
(JSPropertySpec *) unibar_props, NULL,
NULL, NULL);
JS_SetPrivate(ctx, menubar_obj, "t");
JS_SetPrivate(ctx, menubar_obj, "t"); /* to @menubar_class */
statusbar_obj = JS_InitClass(ctx, window_obj, NULL,
(JSClass *) &statusbar_class, NULL, 0,
(JSPropertySpec *) unibar_props, NULL,
NULL, NULL);
JS_SetPrivate(ctx, statusbar_obj, "s");
JS_SetPrivate(ctx, statusbar_obj, "s"); /* to @statusbar_class */
navigator_obj = JS_InitClass(ctx, window_obj, NULL,
(JSClass *) &navigator_class, NULL, 0,

View File

@ -74,7 +74,7 @@ static JSBool
document_get_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
{
JSObject *parent = JS_GetParent(ctx, obj);
struct view_state *vs = JS_GetPrivate(ctx, parent);
struct view_state *vs = JS_GetPrivate(ctx, parent); /* from @window_class */
struct document_view *doc_view = vs->doc_view;
struct document *document = doc_view->document;
struct session *ses = doc_view->session;
@ -161,7 +161,7 @@ static JSBool
document_set_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
{
JSObject *parent = JS_GetParent(ctx, obj);
struct view_state *vs = JS_GetPrivate(ctx, parent);
struct view_state *vs = JS_GetPrivate(ctx, parent); /* from @window_class */
struct document_view *doc_view = vs->doc_view;
struct document *document = doc_view->document;

View File

@ -128,10 +128,10 @@ input_get_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
JSObject *parent_form = JS_GetParent(ctx, obj);
JSObject *parent_doc = JS_GetParent(ctx, parent_form);
JSObject *parent_win = JS_GetParent(ctx, parent_doc);
struct view_state *vs = JS_GetPrivate(ctx, parent_win);
struct view_state *vs = JS_GetPrivate(ctx, parent_win); /* from @window_class */
struct document_view *doc_view = vs->doc_view;
struct document *document = doc_view->document;
struct form_state *fs = JS_GetPrivate(ctx, obj);
struct form_state *fs = JS_GetPrivate(ctx, obj); /* from @input_class */
struct form_control *fc = find_form_control(document, fs);
int linknum;
struct link *link = NULL;
@ -250,10 +250,10 @@ input_set_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
JSObject *parent_form = JS_GetParent(ctx, obj);
JSObject *parent_doc = JS_GetParent(ctx, parent_form);
JSObject *parent_win = JS_GetParent(ctx, parent_doc);
struct view_state *vs = JS_GetPrivate(ctx, parent_win);
struct view_state *vs = JS_GetPrivate(ctx, parent_win); /* from @window_class */
struct document_view *doc_view = vs->doc_view;
struct document *document = doc_view->document;
struct form_state *fs = JS_GetPrivate(ctx, obj);
struct form_state *fs = JS_GetPrivate(ctx, obj); /* from @input_class */
struct form_control *fc = find_form_control(document, fs);
int linknum;
struct link *link = NULL;
@ -350,11 +350,11 @@ input_click(JSContext *ctx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
JSObject *parent_form = JS_GetParent(ctx, obj);
JSObject *parent_doc = JS_GetParent(ctx, parent_form);
JSObject *parent_win = JS_GetParent(ctx, parent_doc);
struct view_state *vs = JS_GetPrivate(ctx, parent_win);
struct view_state *vs = JS_GetPrivate(ctx, parent_win); /* from @window_class */
struct document_view *doc_view = vs->doc_view;
struct document *document = doc_view->document;
struct session *ses = doc_view->session;
struct form_state *fs = JS_GetPrivate(ctx, obj);
struct form_state *fs = JS_GetPrivate(ctx, obj); /* from @input_class */
struct form_control *fc;
int linknum;
@ -385,11 +385,11 @@ input_focus(JSContext *ctx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
JSObject *parent_form = JS_GetParent(ctx, obj);
JSObject *parent_doc = JS_GetParent(ctx, parent_form);
JSObject *parent_win = JS_GetParent(ctx, parent_doc);
struct view_state *vs = JS_GetPrivate(ctx, parent_win);
struct view_state *vs = JS_GetPrivate(ctx, parent_win); /* from @window_class */
struct document_view *doc_view = vs->doc_view;
struct document *document = doc_view->document;
struct session *ses = doc_view->session;
struct form_state *fs = JS_GetPrivate(ctx, obj);
struct form_state *fs = JS_GetPrivate(ctx, obj); /* from @input_class */
struct form_control *fc;
int linknum;
@ -431,7 +431,7 @@ get_input_object(JSContext *ctx, JSObject *jsform, struct form_state *fs)
JS_DefineProperties(ctx, jsinput, (JSPropertySpec *) input_props);
JS_DefineFunctions(ctx, jsinput, (JSFunctionSpec *) input_funcs);
JS_SetPrivate(ctx, jsinput, fs);
JS_SetPrivate(ctx, jsinput, fs); /* to @input_class */
fs->ecmascript_obj = jsinput;
return fs->ecmascript_obj;
}
@ -500,10 +500,10 @@ form_elements_get_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
JSObject *parent_form = JS_GetParent(ctx, obj);
JSObject *parent_doc = JS_GetParent(ctx, parent_form);
JSObject *parent_win = JS_GetParent(ctx, parent_doc);
struct view_state *vs = JS_GetPrivate(ctx, parent_win);
struct view_state *vs = JS_GetPrivate(ctx, parent_win); /* from @window_class */
struct document_view *doc_view = vs->doc_view;
struct document *document = doc_view->document;
struct form_view *form_view = JS_GetPrivate(ctx, parent_form);
struct form_view *form_view = JS_GetPrivate(ctx, parent_form); /* from @form_class */
struct form *form = find_form_by_form_view(document, form_view);
if (JSVAL_IS_STRING(id)) {
@ -536,10 +536,10 @@ form_elements_item(JSContext *ctx, JSObject *obj, uintN argc, jsval *argv, jsval
JSObject *parent_form = JS_GetParent(ctx, obj);
JSObject *parent_doc = JS_GetParent(ctx, parent_form);
JSObject *parent_win = JS_GetParent(ctx, parent_doc);
struct view_state *vs = JS_GetPrivate(ctx, parent_win);
struct view_state *vs = JS_GetPrivate(ctx, parent_win); /* from @window_class */
struct document_view *doc_view = vs->doc_view;
struct document *document = doc_view->document;
struct form_view *form_view = JS_GetPrivate(ctx, parent_form);
struct form_view *form_view = JS_GetPrivate(ctx, parent_form); /* from @form_class */
struct form *form = find_form_by_form_view(document, form_view);
struct form_control *fc;
int counter = -1;
@ -574,10 +574,10 @@ form_elements_namedItem(JSContext *ctx, JSObject *obj, uintN argc, jsval *argv,
JSObject *parent_form = JS_GetParent(ctx, obj);
JSObject *parent_doc = JS_GetParent(ctx, parent_form);
JSObject *parent_win = JS_GetParent(ctx, parent_doc);
struct view_state *vs = JS_GetPrivate(ctx, parent_win);
struct view_state *vs = JS_GetPrivate(ctx, parent_win); /* from @window_class */
struct document_view *doc_view = vs->doc_view;
struct document *document = doc_view->document;
struct form_view *form_view = JS_GetPrivate(ctx, parent_form);
struct form_view *form_view = JS_GetPrivate(ctx, parent_form); /* from @form_class */
struct form *form = find_form_by_form_view(document, form_view);
struct form_control *fc;
unsigned char *string;
@ -656,9 +656,9 @@ form_get_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
/* DBG("doc %p %s\n", parent_doc, JS_GetStringBytes(JS_ValueToString(ctx, OBJECT_TO_JSVAL(parent_doc)))); */
JSObject *parent_doc = JS_GetParent(ctx, obj);
JSObject *parent_win = JS_GetParent(ctx, parent_doc);
struct view_state *vs = JS_GetPrivate(ctx, parent_win);
struct view_state *vs = JS_GetPrivate(ctx, parent_win); /* from @window_class */
struct document_view *doc_view = vs->doc_view;
struct form_view *fv = JS_GetPrivate(ctx, obj);
struct form_view *fv = JS_GetPrivate(ctx, obj); /* from @form_class */
struct form *form = find_form_by_form_view(doc_view->document, fv);
assert(form);
@ -763,9 +763,9 @@ form_set_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
{
JSObject *parent_doc = JS_GetParent(ctx, obj);
JSObject *parent_win = JS_GetParent(ctx, parent_doc);
struct view_state *vs = JS_GetPrivate(ctx, parent_win);
struct view_state *vs = JS_GetPrivate(ctx, parent_win); /* from @window_class */
struct document_view *doc_view = vs->doc_view;
struct form_view *fv = JS_GetPrivate(ctx, obj);
struct form_view *fv = JS_GetPrivate(ctx, obj); /* from @form_class */
struct form *form = find_form_by_form_view(doc_view->document, fv);
unsigned char *string;
@ -827,9 +827,9 @@ form_reset(JSContext *ctx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
{
JSObject *parent_doc = JS_GetParent(ctx, obj);
JSObject *parent_win = JS_GetParent(ctx, parent_doc);
struct view_state *vs = JS_GetPrivate(ctx, parent_win);
struct view_state *vs = JS_GetPrivate(ctx, parent_win); /* from @window_class */
struct document_view *doc_view = vs->doc_view;
struct form_view *fv = JS_GetPrivate(ctx, obj);
struct form_view *fv = JS_GetPrivate(ctx, obj); /* from @form_class */
struct form *form = find_form_by_form_view(doc_view->document, fv);
assert(form);
@ -848,10 +848,10 @@ form_submit(JSContext *ctx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
{
JSObject *parent_doc = JS_GetParent(ctx, obj);
JSObject *parent_win = JS_GetParent(ctx, parent_doc);
struct view_state *vs = JS_GetPrivate(ctx, parent_win);
struct view_state *vs = JS_GetPrivate(ctx, parent_win); /* from @window_class */
struct document_view *doc_view = vs->doc_view;
struct session *ses = doc_view->session;
struct form_view *fv = JS_GetPrivate(ctx, obj);
struct form_view *fv = JS_GetPrivate(ctx, obj); /* from @form_class */
struct form *form = find_form_by_form_view(doc_view->document, fv);
assert(form);
@ -876,7 +876,7 @@ get_form_object(JSContext *ctx, JSObject *jsdoc, struct form_view *fv)
JS_DefineProperties(ctx, jsform, (JSPropertySpec *) form_props);
JS_DefineFunctions(ctx, jsform, (JSFunctionSpec *) form_funcs);
JS_SetPrivate(ctx, jsform, fv);
JS_SetPrivate(ctx, jsform, fv); /* to @form_class */
fv->ecmascript_obj = jsform;
return fv->ecmascript_obj;
}
@ -916,7 +916,7 @@ forms_get_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
{
JSObject *parent_doc = JS_GetParent(ctx, obj);
JSObject *parent_win = JS_GetParent(ctx, parent_doc);
struct view_state *vs = JS_GetPrivate(ctx, parent_win);
struct view_state *vs = JS_GetPrivate(ctx, parent_win); /* from @window_class */
struct document_view *doc_view = vs->doc_view;
struct document *document = doc_view->document;
@ -947,7 +947,7 @@ forms_item(JSContext *ctx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
{
JSObject *parent_doc = JS_GetParent(ctx, obj);
JSObject *parent_win = JS_GetParent(ctx, parent_doc);
struct view_state *vs = JS_GetPrivate(ctx, parent_win);
struct view_state *vs = JS_GetPrivate(ctx, parent_win); /* from @window_class */
struct form_view *fv;
int counter = -1;
int index;
@ -976,7 +976,7 @@ forms_namedItem(JSContext *ctx, JSObject *obj, uintN argc, jsval *argv, jsval *r
{
JSObject *parent_doc = JS_GetParent(ctx, obj);
JSObject *parent_win = JS_GetParent(ctx, parent_doc);
struct view_state *vs = JS_GetPrivate(ctx, parent_win);
struct view_state *vs = JS_GetPrivate(ctx, parent_win); /* from @window_class */
struct document_view *doc_view = vs->doc_view;
struct document *document = doc_view->document;
struct form *form;

View File

@ -146,7 +146,7 @@ static JSBool
location_get_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
{
JSObject *parent = JS_GetParent(ctx, obj);
struct view_state *vs = JS_GetPrivate(ctx, parent);
struct view_state *vs = JS_GetPrivate(ctx, parent); /* from @window_class */
if (!JSVAL_IS_INT(id))
return JS_TRUE;
@ -170,7 +170,7 @@ static JSBool
location_set_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
{
JSObject *parent = JS_GetParent(ctx, obj);
struct view_state *vs = JS_GetPrivate(ctx, parent);
struct view_state *vs = JS_GetPrivate(ctx, parent); /* from @window_class */
struct document_view *doc_view = vs->doc_view;
if (!JSVAL_IS_INT(id))

View File

@ -76,10 +76,10 @@ static JSBool
unibar_get_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
{
JSObject *parent = JS_GetParent(ctx, obj);
struct view_state *vs = JS_GetPrivate(ctx, parent);
struct view_state *vs = JS_GetPrivate(ctx, parent); /* from @window_class */
struct document_view *doc_view = vs->doc_view;
struct session_status *status = &doc_view->session->status;
unsigned char *bar = JS_GetPrivate(ctx, obj);
unsigned char *bar = JS_GetPrivate(ctx, obj); /* from @menubar_class or @statusbar_class */
if (!JSVAL_IS_INT(id))
return JS_TRUE;
@ -116,10 +116,10 @@ static JSBool
unibar_set_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
{
JSObject *parent = JS_GetParent(ctx, obj);
struct view_state *vs = JS_GetPrivate(ctx, parent);
struct view_state *vs = JS_GetPrivate(ctx, parent); /* from @window_class */
struct document_view *doc_view = vs->doc_view;
struct session_status *status = &doc_view->session->status;
unsigned char *bar = JS_GetPrivate(ctx, obj);
unsigned char *bar = JS_GetPrivate(ctx, obj); /* from @menubar_class or @statusbar_class */
if (!JSVAL_IS_INT(id))
return JS_TRUE;

View File

@ -120,7 +120,7 @@ find_child_frame(struct document_view *doc_view, struct frame_desc *tframe)
static JSBool
window_get_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
{
struct view_state *vs = JS_GetPrivate(ctx, obj);
struct view_state *vs = JS_GetPrivate(ctx, obj); /* from @window_class */
/* No need for special window.location measurements - when
* location is then evaluated in string context, toString()
@ -239,7 +239,7 @@ void location_goto(struct document_view *doc_view, unsigned char *url);
static JSBool
window_set_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
{
struct view_state *vs = JS_GetPrivate(ctx, obj);
struct view_state *vs = JS_GetPrivate(ctx, obj); /* from @window_class */
if (JSVAL_IS_STRING(id)) {
if (!strcmp(jsval_to_string(ctx, &id), "location")) {
@ -285,7 +285,7 @@ const JSFunctionSpec window_funcs[] = {
static JSBool
window_alert(JSContext *ctx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
{
struct view_state *vs = JS_GetPrivate(ctx, obj);
struct view_state *vs = JS_GetPrivate(ctx, obj); /* from @window_class */
unsigned char *string;
if (argc != 1)
@ -306,7 +306,7 @@ window_alert(JSContext *ctx, JSObject *obj, uintN argc, jsval *argv, jsval *rval
static JSBool
window_open(JSContext *ctx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
{
struct view_state *vs = JS_GetPrivate(ctx, obj);
struct view_state *vs = JS_GetPrivate(ctx, obj); /* from @window_class */
struct document_view *doc_view = vs->doc_view;
struct session *ses = doc_view->session;
unsigned char *frame = "";

View File

@ -25,7 +25,7 @@ struct smjs_action_fn_callback_hop {
static void
smjs_action_fn_finalize(JSContext *ctx, JSObject *obj)
{
struct smjs_action_fn_callback_hop *hop = JS_GetPrivate(ctx, obj);
struct smjs_action_fn_callback_hop *hop = JS_GetPrivate(ctx, obj); /* from @action_fn_class */
if (hop) mem_free(hop);
}
@ -45,7 +45,7 @@ smjs_action_fn_callback(JSContext *ctx, JSObject *obj, uintN argc, jsval *argv,
if (JS_TRUE != JS_ValueToObject(ctx, argv[-2], &fn_obj))
return JS_TRUE;
hop = JS_GetPrivate(ctx, fn_obj);
hop = JS_GetPrivate(ctx, fn_obj); /* from @action_fn_class */
if (!hop) return JS_TRUE;
if (argc >= 1) {
@ -99,7 +99,7 @@ smjs_get_action_fn_object(unsigned char *action_str)
hop->action_id = get_action_from_string(KEYMAP_MAIN, action_str);
if (-1 != hop->action_id
&& JS_TRUE == JS_SetPrivate(smjs_ctx, obj, hop)) {
&& JS_TRUE == JS_SetPrivate(smjs_ctx, obj, hop)) { /* to @action_fn_class */
return obj;
}

View File

@ -26,7 +26,7 @@ smjs_get_bookmark_generic_object(struct bookmark *bookmark, JSClass *clasp)
if (!bookmark) return jsobj;
if (JS_TRUE == JS_SetPrivate(smjs_ctx, jsobj, bookmark)) {
if (JS_TRUE == JS_SetPrivate(smjs_ctx, jsobj, bookmark)) { /* to @bookmark_class or @bookmark_folder_class */
object_lock(bookmark);
return jsobj;
@ -39,7 +39,7 @@ smjs_get_bookmark_generic_object(struct bookmark *bookmark, JSClass *clasp)
static void
bookmark_finalize(JSContext *ctx, JSObject *obj)
{
struct bookmark *bookmark = JS_GetPrivate(ctx, obj);
struct bookmark *bookmark = JS_GetPrivate(ctx, obj); /* from @bookmark_class or @bookmark_folder_class */
if (bookmark) object_unlock(bookmark);
}
@ -66,7 +66,7 @@ static JSObject *smjs_get_bookmark_folder_object(struct bookmark *bookmark);
static JSBool
bookmark_get_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
{
struct bookmark *bookmark = JS_GetPrivate(ctx, obj);
struct bookmark *bookmark = JS_GetPrivate(ctx, obj); /* from @bookmark_class */
if (!bookmark) return JS_FALSE;
@ -102,7 +102,7 @@ bookmark_get_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
static JSBool
bookmark_set_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
{
struct bookmark *bookmark = JS_GetPrivate(ctx, obj);
struct bookmark *bookmark = JS_GetPrivate(ctx, obj); /* from @bookmark_class */
if (!bookmark) return JS_FALSE;
@ -166,7 +166,7 @@ static JSBool
bookmark_folder_get_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
{
struct bookmark *bookmark;
struct bookmark *folder = JS_GetPrivate(ctx, obj);
struct bookmark *folder = JS_GetPrivate(ctx, obj); /* from @bookmark_folder_class */
unsigned char *title;
*vp = JSVAL_NULL;

View File

@ -35,7 +35,7 @@ static const JSPropertySpec cache_entry_props[] = {
static JSBool
cache_entry_get_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
{
struct cache_entry *cached = JS_GetPrivate(ctx, obj);
struct cache_entry *cached = JS_GetPrivate(ctx, obj); /* from @cache_entry_class */
if (!cache_entry_is_valid(cached)) return JS_FALSE;
@ -87,7 +87,7 @@ cache_entry_get_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
static JSBool
cache_entry_set_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
{
struct cache_entry *cached = JS_GetPrivate(ctx, obj);
struct cache_entry *cached = JS_GetPrivate(ctx, obj); /* from @cache_entry_class */
if (!cache_entry_is_valid(cached)) return JS_FALSE;
@ -135,7 +135,7 @@ cache_entry_set_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
static void
cache_entry_finalize(JSContext *ctx, JSObject *obj)
{
struct cache_entry *cached = JS_GetPrivate(ctx, obj);
struct cache_entry *cached = JS_GetPrivate(ctx, obj); /* from @cache_entry_class */
if (!cached) return;
@ -163,7 +163,7 @@ smjs_get_cache_entry_object(struct cache_entry *cached)
if (!cache_entry_object) return NULL;
if (JS_FALSE == JS_SetPrivate(smjs_ctx, cache_entry_object, cached))
if (JS_FALSE == JS_SetPrivate(smjs_ctx, cache_entry_object, cached)) /* to @cache_entry_class */
return NULL;
object_lock(cached);

View File

@ -17,7 +17,7 @@
static void
smjs_globhist_item_finalize(JSContext *ctx, JSObject *obj)
{
struct global_history_item *history_item = JS_GetPrivate(ctx, obj);
struct global_history_item *history_item = JS_GetPrivate(ctx, obj); /* from @smjs_globhist_item_class */
if (history_item) object_unlock(history_item);
}
@ -40,7 +40,7 @@ static JSBool
smjs_globhist_item_get_property(JSContext *ctx, JSObject *obj, jsval id,
jsval *vp)
{
struct global_history_item *history_item = JS_GetPrivate(ctx, obj);
struct global_history_item *history_item = JS_GetPrivate(ctx, obj); /* from @smjs_globhist_item_class */
if (!history_item) return JS_FALSE;
@ -92,7 +92,7 @@ smjs_globhist_item_get_property(JSContext *ctx, JSObject *obj, jsval id,
static JSBool
smjs_globhist_item_set_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
{
struct global_history_item *history_item = JS_GetPrivate(ctx, obj);
struct global_history_item *history_item = JS_GetPrivate(ctx, obj); /* from @smjs_globhist_item_class */
if (!history_item) return JS_FALSE;
@ -151,7 +151,7 @@ smjs_get_globhist_item_object(struct global_history_item *history_item)
if (!jsobj
|| JS_TRUE != JS_DefineProperties(smjs_ctx, jsobj,
(JSPropertySpec *) smjs_globhist_item_props)
|| JS_TRUE != JS_SetPrivate(smjs_ctx, jsobj, history_item))
|| JS_TRUE != JS_SetPrivate(smjs_ctx, jsobj, history_item)) /* to @smjs_globhist_item_class */
return NULL;
object_lock(history_item);

View File

@ -19,7 +19,7 @@ keymap_get_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
{
unsigned char *action_str;
const unsigned char *keystroke_str;
int *data = JS_GetPrivate(ctx, obj);
int *data = JS_GetPrivate(ctx, obj); /* from @keymap_class */
enum keymap_id keymap_id = *data;
keystroke_str = JS_GetStringBytes(JS_ValueToString(ctx, id));
@ -63,7 +63,7 @@ smjs_keybinding_action_callback(va_list ap, void *data)
static JSBool
keymap_set_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
{
int *data = JS_GetPrivate(ctx, obj);
int *data = JS_GetPrivate(ctx, obj); /* from @keymap_class */
enum keymap_id keymap_id = *data;
unsigned char *keymap_str;
const unsigned char *keystroke_str;
@ -133,7 +133,7 @@ keymap_set_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
static void
keymap_finalize(JSContext *ctx, JSObject *obj)
{
void *data = JS_GetPrivate(ctx, obj);
void *data = JS_GetPrivate(ctx, obj); /* from @keymap_class */
mem_free(data);
}
@ -162,7 +162,7 @@ smjs_get_keymap_object(enum keymap_id keymap_id)
data = intdup(keymap_id);
if (!data) return NULL;
if (JS_TRUE == JS_SetPrivate(smjs_ctx, keymap_object, data))
if (JS_TRUE == JS_SetPrivate(smjs_ctx, keymap_object, data)) /* to @keymap_class */
return keymap_object;
mem_free(data);

View File

@ -35,7 +35,7 @@ static const JSPropertySpec view_state_props[] = {
static JSBool
view_state_get_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
{
struct view_state *vs = JS_GetPrivate(ctx, obj);
struct view_state *vs = JS_GetPrivate(ctx, obj); /* from @view_state_class */
undef_to_jsval(ctx, vp);
@ -64,7 +64,7 @@ view_state_get_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
static JSBool
view_state_set_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
{
struct view_state *vs = JS_GetPrivate(ctx, obj);
struct view_state *vs = JS_GetPrivate(ctx, obj); /* from @view_state_class */
if (!JSVAL_IS_INT(id))
return JS_FALSE;
@ -104,7 +104,7 @@ smjs_get_view_state_object(struct view_state *vs)
if (!view_state_object) return NULL;
if (JS_FALSE == JS_SetPrivate(smjs_ctx, view_state_object, vs))
if (JS_FALSE == JS_SetPrivate(smjs_ctx, view_state_object, vs)) /* to @view_state_class */
return NULL;
if (JS_FALSE == JS_DefineProperties(smjs_ctx, view_state_object,