mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
[spidermonkey] console - get rid of warnings
This commit is contained in:
parent
e25654404c
commit
08b7d32cd4
@ -33,8 +33,6 @@
|
|||||||
|
|
||||||
#define DEBUG 0
|
#define DEBUG 0
|
||||||
|
|
||||||
static bool console_get_property(JSContext *ctx, JS::HandleObject hobj, JS::HandleId hid, JS::MutableHandleValue hvp);
|
|
||||||
|
|
||||||
JSClassOps console_ops = {
|
JSClassOps console_ops = {
|
||||||
nullptr, // addProperty
|
nullptr, // addProperty
|
||||||
nullptr, // deleteProperty
|
nullptr, // deleteProperty
|
||||||
@ -56,23 +54,6 @@ const JSClass console_class = {
|
|||||||
&console_ops
|
&console_ops
|
||||||
};
|
};
|
||||||
|
|
||||||
/* @console_class.getProperty */
|
|
||||||
static bool
|
|
||||||
console_get_property(JSContext *ctx, JS::HandleObject hobj, JS::HandleId hid, JS::MutableHandleValue hvp)
|
|
||||||
{
|
|
||||||
#ifdef ECMASCRIPT_DEBUG
|
|
||||||
fprintf(stderr, "%s:%s\n", __FILE__, __FUNCTION__);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
JSObject *parent_win; /* instance of @window_class */
|
|
||||||
struct view_state *vs;
|
|
||||||
struct document_view *doc_view;
|
|
||||||
struct document *document;
|
|
||||||
struct session *ses;
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool console_error(JSContext *ctx, unsigned int argc, JS::Value *vp);
|
static bool console_error(JSContext *ctx, unsigned int argc, JS::Value *vp);
|
||||||
static bool console_log(JSContext *ctx, unsigned int argc, JS::Value *vp);
|
static bool console_log(JSContext *ctx, unsigned int argc, JS::Value *vp);
|
||||||
|
|
||||||
@ -85,7 +66,6 @@ const spidermonkeyFunctionSpec console_funcs[] = {
|
|||||||
static bool
|
static bool
|
||||||
console_log_common(JSContext *ctx, unsigned int argc, JS::Value *vp, const char *log_filename)
|
console_log_common(JSContext *ctx, unsigned int argc, JS::Value *vp, const char *log_filename)
|
||||||
{
|
{
|
||||||
struct ecmascript_interpreter *interpreter = JS_GetContextPrivate(ctx);
|
|
||||||
JS::CallArgs args = CallArgsFromVp(argc, vp);
|
JS::CallArgs args = CallArgsFromVp(argc, vp);
|
||||||
|
|
||||||
if (argc != 1 || !log_filename)
|
if (argc != 1 || !log_filename)
|
||||||
@ -96,7 +76,7 @@ console_log_common(JSContext *ctx, unsigned int argc, JS::Value *vp, const char
|
|||||||
|
|
||||||
if (get_opt_bool("ecmascript.enable_console_log", NULL))
|
if (get_opt_bool("ecmascript.enable_console_log", NULL))
|
||||||
{
|
{
|
||||||
unsigned char *key = jsval_to_string(ctx, args[0]);
|
char *key = jsval_to_string(ctx, args[0]);
|
||||||
|
|
||||||
FILE *f = fopen(log_filename, "a");
|
FILE *f = fopen(log_filename, "a");
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ heartbeat_callback(JSContext *ctx)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct ecmascript_interpreter *interpreter = JS::GetRealmPrivate(comp);
|
struct ecmascript_interpreter *interpreter = (struct ecmascript_interpreter *)JS::GetRealmPrivate(comp);
|
||||||
|
|
||||||
if (!interpreter || !interpreter->heartbeat || interpreter->heartbeat->ttl > 0) {
|
if (!interpreter || !interpreter->heartbeat || interpreter->heartbeat->ttl > 0) {
|
||||||
return true;
|
return true;
|
||||||
@ -74,7 +74,7 @@ check_heartbeats(void *data)
|
|||||||
|
|
||||||
ecmascript_timeout_dialog(term, max_exec_time);
|
ecmascript_timeout_dialog(term, max_exec_time);
|
||||||
}
|
}
|
||||||
JS_RequestInterruptCallback(hb->interpreter->backend_data);
|
JS_RequestInterruptCallback((JSContext *)hb->interpreter->backend_data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
install_signal_handler(SIGVTALRM, check_heartbeats, NULL, 1);
|
install_signal_handler(SIGVTALRM, check_heartbeats, NULL, 1);
|
||||||
|
@ -8,7 +8,6 @@ static void string_to_jsval(JSContext *ctx, JS::Value *vp, char *string);
|
|||||||
static void astring_to_jsval(JSContext *ctx, JS::Value *vp, char *string);
|
static void astring_to_jsval(JSContext *ctx, JS::Value *vp, char *string);
|
||||||
|
|
||||||
static int jsval_to_boolean(JSContext *ctx, JS::Value *vp);
|
static int jsval_to_boolean(JSContext *ctx, JS::Value *vp);
|
||||||
static void jshandle_value_to_char_string(struct string *string, JSContext *ctx, JS::HandleValue obj);
|
|
||||||
|
|
||||||
/** Inline functions */
|
/** Inline functions */
|
||||||
|
|
||||||
@ -40,7 +39,7 @@ jsval_to_boolean(JSContext *ctx, JS::Value *vp)
|
|||||||
/* Since SpiderMonkey 52 the Mutable Handle Object
|
/* Since SpiderMonkey 52 the Mutable Handle Object
|
||||||
* is different for String and Number and must be
|
* is different for String and Number and must be
|
||||||
* handled accordingly */
|
* handled accordingly */
|
||||||
void
|
static inline void
|
||||||
jshandle_value_to_char_string(struct string *string, JSContext *ctx, JS::HandleValue obj)
|
jshandle_value_to_char_string(struct string *string, JSContext *ctx, JS::HandleValue obj)
|
||||||
{
|
{
|
||||||
if (!init_string(string)) {
|
if (!init_string(string)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user