summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorportix <none@none>2012-11-03 12:27:54 +0100
committerportix <none@none>2012-11-03 12:27:54 +0100
commitcb00c6e6d113423a19bcd4d3c44ec04a615259cc (patch)
tree5fdc7d5639341c9df8002904c88fc7dd129c8577 /src
parentd2ca0500bfbee25d107e83dfadacffb7ae7635b3 (diff)
parentf105566dcba5a57daeed7b5e6a3f8845a8ec175f (diff)
downloaddwb-cb00c6e6d113423a19bcd4d3c44ec04a615259cc.zip
Automated merge with ssh://bitbucket.org/portix/dwb
Diffstat (limited to 'src')
-rw-r--r--src/scripts.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/scripts.c b/src/scripts.c
index 1b2a7ecf..7bfb84df 100644
--- a/src/scripts.c
+++ b/src/scripts.c
@@ -1557,7 +1557,10 @@ scripts_emit(ScriptSignal *sig) {
val[i++] = sig->jsobj;
}
for (int j=0; j<sig->numobj; j++) {
- val[i++] = make_object(m_global_context, G_OBJECT(sig->objects[j]));
+ if (sig->objects[j] != NULL)
+ val[i++] = make_object(m_global_context, G_OBJECT(sig->objects[j]));
+ else
+ val[i++] = JSValueMakeNull(m_global_context);
}
JSValueRef vson = js_json_to_value(m_global_context, sig->json);
val[i++] = vson == NULL ? JSValueMakeNull(m_global_context) : vson;
@@ -2022,7 +2025,7 @@ void
scripts_init_script(const char *path, const char *script) {
if (m_global_context == NULL)
create_global_object();
- char *debug = g_strdup_printf("try { %s } catch(e) { io.debug(\"In file %s\", e); }", script, path);
+ char *debug = g_strdup_printf("\ntry{/*<dwb*/%s/*dwb>*/}catch(e) { io.debug({message : \"In file %s\", error : e}); }", script, path);
JSObjectRef function = js_make_function(m_global_context, debug);
if (function != NULL) {
m_script_list = g_slist_prepend(m_script_list, function);