diff --git a/src/scripting/smjs/action_object.cpp b/src/scripting/smjs/action_object.cpp index 86b56ae0..e3bee0ee 100644 --- a/src/scripting/smjs/action_object.cpp +++ b/src/scripting/smjs/action_object.cpp @@ -118,7 +118,7 @@ smjs_action_fn_callback(JSContext *ctx, unsigned int argc, JS::Value *rval) return true; } - +#if 0 static JSObject * smjs_get_action_fn_object(char *action_str) { @@ -151,10 +151,11 @@ smjs_get_action_fn_object(char *action_str) mem_free(hop); return NULL; } - +#endif /*** elinks.action object ***/ +#if 0 /* @action_class.getProperty */ static bool action_get_property(JSContext *ctx, JS::HandleObject hobj, JS::HandleId hid, JS::MutableHandleValue hvp) @@ -179,6 +180,7 @@ action_get_property(JSContext *ctx, JS::HandleObject hobj, JS::HandleId hid, JS: return true; } +#endif static JSClassOps action_ops = { nullptr, // addProperty diff --git a/src/scripting/smjs/bookmarks.cpp b/src/scripting/smjs/bookmarks.cpp index 1393afc5..3e05f85e 100644 --- a/src/scripting/smjs/bookmarks.cpp +++ b/src/scripting/smjs/bookmarks.cpp @@ -18,7 +18,7 @@ /*** common code ***/ static void bookmark_finalize(JS::GCContext *op, JSObject *obj); -static bool bookmark_folder_get_property(JSContext *ctx, JS::HandleObject hobj, JS::HandleId hid, JS::MutableHandleValue hvp); +//static bool bookmark_folder_get_property(JSContext *ctx, JS::HandleObject hobj, JS::HandleId hid, JS::MutableHandleValue hvp); static JSClassOps bookmark_ops = { nullptr, // addProperty @@ -113,6 +113,7 @@ static const JSPropertySpec bookmark_props[] = { static JSObject *smjs_get_bookmark_folder_object(struct bookmark *bookmark); +#if 0 /** Convert a string retrieved from struct bookmark to a jsval. * * @return true if successful. On error, report the error and @@ -127,6 +128,7 @@ bookmark_string_to_jsval(JSContext *ctx, const char *str, JS::Value *vp) *vp = JS::StringValue(jsstr); return true; } +#endif /** Convert a JS::Value to a string and store it in struct bookmark. * @@ -290,7 +292,7 @@ bookmark_get_property_children(JSContext *ctx, unsigned int argc, JS::Value *vp) return true; } - +#if 0 static JSObject * smjs_get_bookmark_object(struct bookmark *bookmark) { @@ -307,10 +309,11 @@ smjs_get_bookmark_object(struct bookmark *bookmark) return NULL; } - +#endif /*** bookmark folder object ***/ +#if 0 /* @bookmark_folder_class.getProperty */ static bool bookmark_folder_get_property(JSContext *ctx, JS::HandleObject hobj, JS::HandleId hid, JS::MutableHandleValue hvp) @@ -347,7 +350,7 @@ bookmark_folder_get_property(JSContext *ctx, JS::HandleObject hobj, JS::HandleId mem_free(title); return true; } - +#endif static JSObject * smjs_get_bookmark_folder_object(struct bookmark *bookmark) diff --git a/src/scripting/smjs/globhist.cpp b/src/scripting/smjs/globhist.cpp index 4ac5e4af..f9de3161 100644 --- a/src/scripting/smjs/globhist.cpp +++ b/src/scripting/smjs/globhist.cpp @@ -12,8 +12,8 @@ #include "scripting/smjs/elinks_object.h" #include "util/memory.h" -static bool smjs_globhist_item_get_property(JSContext *ctx, JS::HandleObject hobj, JS::HandleId hid, JS::MutableHandleValue hvp); -static bool smjs_globhist_item_set_property(JSContext *ctx, JS::HandleObject hobj, JS::HandleId hid, JS::MutableHandleValue hvp); +//static bool smjs_globhist_item_get_property(JSContext *ctx, JS::HandleObject hobj, JS::HandleId hid, JS::MutableHandleValue hvp); +//static bool smjs_globhist_item_set_property(JSContext *ctx, JS::HandleObject hobj, JS::HandleId hid, JS::MutableHandleValue hvp); static void smjs_globhist_item_finalize(JS::GCContext *op, JSObject *obj); @@ -24,7 +24,7 @@ static const JSClassOps smjs_globhist_item_ops = { nullptr, // newEnumerate nullptr, // resolve nullptr, // mayResolve - nullptr, // finalize + smjs_globhist_item_finalize, // finalize nullptr, // call nullptr, // construct nullptr // trace JS_GlobalObjectTraceHook @@ -61,6 +61,7 @@ static const JSPropertySpec smjs_globhist_item_props[] = { JS_PS_END }; +#if 0 static JSObject * smjs_get_globhist_item_object(struct global_history_item *history_item) { @@ -80,8 +81,9 @@ smjs_get_globhist_item_object(struct global_history_item *history_item) return jsobj; } +#endif - +#if 0 /* @smjs_globhist_class.getProperty */ static bool smjs_globhist_get_property(JSContext *ctx, JS::HandleObject hobj, JS::HandleId hid, JS::MutableHandleValue hvp) @@ -115,6 +117,7 @@ ret_null: return true; } +#endif static const JSClassOps smjs_globhist_ops = { nullptr, // addProperty diff --git a/src/scripting/smjs/keybinding.cpp b/src/scripting/smjs/keybinding.cpp index fe0655c0..b41ad13a 100644 --- a/src/scripting/smjs/keybinding.cpp +++ b/src/scripting/smjs/keybinding.cpp @@ -13,8 +13,8 @@ #include "scripting/smjs/elinks_object.h" #include "util/memory.h" -static bool keymap_get_property(JSContext *ctx, JS::HandleObject hobj, JS::HandleId hid, JS::MutableHandleValue hvp); -static bool keymap_set_property(JSContext *ctx, JS::HandleObject hobj, JS::HandleId hid, JS::MutableHandleValue hvp); +//static bool keymap_get_property(JSContext *ctx, JS::HandleObject hobj, JS::HandleId hid, JS::MutableHandleValue hvp); +//static bool keymap_set_property(JSContext *ctx, JS::HandleObject hobj, JS::HandleId hid, JS::MutableHandleValue hvp); static void keymap_finalize(JS::GCContext *op, JSObject *obj); static const JSClassOps keymap_ops = { @@ -36,6 +36,7 @@ static const JSClass keymap_class = { &keymap_ops }; +#if 0 /* @keymap_class.getProperty */ static bool keymap_get_property(JSContext *ctx, JS::HandleObject hobj, JS::HandleId hid, JS::MutableHandleValue hvp) @@ -75,7 +76,9 @@ ret_null: return true; } +#endif +#if 0 static enum evhook_status smjs_keybinding_action_callback(va_list ap, void *data) { @@ -101,7 +104,9 @@ smjs_keybinding_action_callback(va_list ap, void *data) return EVENT_HOOK_STATUS_LAST; } +#endif +#if 0 /* @keymap_class.setProperty */ static bool keymap_set_property(JSContext *ctx, JS::HandleObject hobj, JS::HandleId hid, JS::MutableHandleValue hvp) @@ -146,7 +151,7 @@ keymap_set_property(JSContext *ctx, JS::HandleObject hobj, JS::HandleId hid, JS: } else if (hvp.isNull()) { /* before JSVAL_IS_OBJECT */ - if (bind_do(keymap_str, keystroke_str, "none", 0)) + if (bind_do(keymap_str, keystroke_str, (char *)"none", 0)) return false; return true; @@ -192,6 +197,7 @@ keymap_set_property(JSContext *ctx, JS::HandleObject hobj, JS::HandleId hid, JS: return false; } +#endif /* @keymap_class.finalize */ static void diff --git a/src/scripting/smjs/session_object.cpp b/src/scripting/smjs/session_object.cpp index 69125665..988092e3 100644 --- a/src/scripting/smjs/session_object.cpp +++ b/src/scripting/smjs/session_object.cpp @@ -30,8 +30,8 @@ static JSObject *smjs_session_object; -static bool session_get_property(JSContext *ctx, JS::HandleObject hobj, JS::HandleId hid, JS::MutableHandleValue hvp); -static bool session_set_property(JSContext *ctx, JS::HandleObject hobj, JS::HandleId hid, JS::MutableHandleValue hvp); +//static bool session_get_property(JSContext *ctx, JS::HandleObject hobj, JS::HandleId hid, JS::MutableHandleValue hvp); +//static bool session_set_property(JSContext *ctx, JS::HandleObject hobj, JS::HandleId hid, JS::MutableHandleValue hvp); static void session_finalize(JS::GCContext *op, JSObject *obj); static bool session_construct(JSContext *ctx, unsigned int argc, JS::Value *rval); @@ -54,7 +54,7 @@ static const JSClass session_class = { &session_ops }; -static bool smjs_location_array_get_property(JSContext *ctx, JS::HandleObject hobj, JS::HandleId hid, JS::MutableHandleValue hvp); +//static bool smjs_location_array_get_property(JSContext *ctx, JS::HandleObject hobj, JS::HandleId hid, JS::MutableHandleValue hvp); static void smjs_location_array_finalize(JS::GCContext *op, JSObject *obj); static const JSClassOps location_array_ops = { @@ -76,6 +76,7 @@ static const JSClass location_array_class = { &location_array_ops }; +#if 0 /* location_array_class is the class for array object, the elements of which * correspond to the elements of session.history. * @@ -130,6 +131,7 @@ smjs_location_array_get_property(JSContext *ctx, JS::HandleObject hobj, JS::Hand return false; } +#endif /** Pointed to by location_array_class.finalize. SpiderMonkey automatically * finalizes all objects before it frees the JSRuntime, so @@ -554,6 +556,7 @@ session_get_property_last_search_word(JSContext *ctx, unsigned int argc, JS::Val return true; } +#if 0 /* @session_class.getProperty */ static bool session_get_property(JSContext *ctx, JS::HandleObject hobj, JS::HandleId hid, JS::MutableHandleValue hvp) @@ -579,6 +582,7 @@ session_get_property(JSContext *ctx, JS::HandleObject hobj, JS::HandleId hid, JS return false; } +#endif static bool session_set_property_visited(JSContext *ctx, unsigned int argc, JS::Value *vp) @@ -844,7 +848,7 @@ session_set_property_last_search_word(JSContext *ctx, unsigned int argc, JS::Val } - +#if 0 static bool session_set_property(JSContext *ctx, JS::HandleObject hobj, JS::HandleId hid, JS::MutableHandleValue hvp) { @@ -866,6 +870,7 @@ session_set_property(JSContext *ctx, JS::HandleObject hobj, JS::HandleId hid, JS return false; } +#endif /** Pointed to by session_class.construct. Create a new session (tab) * and return the JSObject wrapper. */ @@ -974,7 +979,7 @@ smjs_detach_session_object(struct session *ses) } } - +#if 0 /** Ensure that no JSObject contains the pointer @a ses. This is * called when the reference count of the session object *@a ses is * already 0 and it is about to be freed. If a JSObject was @@ -1012,6 +1017,7 @@ session_array_get_property(JSContext *ctx, JS::HandleObject hobj, JS::HandleId h return true; } +#endif static const JSClassOps session_array_ops = { nullptr, // addProperty @@ -1074,7 +1080,6 @@ smjs_session_goto_url(JSContext *ctx, unsigned int argc, JS::Value *rval) struct delayed_open *deo; struct uri *uri; - JSString *jsstr; char *url; struct session *ses; diff --git a/src/scripting/smjs/view_state_object.cpp b/src/scripting/smjs/view_state_object.cpp index 9de75852..8d396151 100644 --- a/src/scripting/smjs/view_state_object.cpp +++ b/src/scripting/smjs/view_state_object.cpp @@ -20,8 +20,8 @@ #include "util/memory.h" #include "viewer/text/vs.h" -static bool view_state_get_property(JSContext *ctx, JS::HandleObject hobj, JS::HandleId hid, JS::MutableHandleValue hvp); -static bool view_state_set_property(JSContext *ctx, JS::HandleObject hobj, JS::HandleId hid, JS::MutableHandleValue hvp); +//static bool view_state_get_property(JSContext *ctx, JS::HandleObject hobj, JS::HandleId hid, JS::MutableHandleValue hvp); +//static bool view_state_set_property(JSContext *ctx, JS::HandleObject hobj, JS::HandleId hid, JS::MutableHandleValue hvp); static void view_state_finalize(JS::GCContext *op, JSObject *obj); static const JSClassOps view_state_ops = {