From d2ca0500bfbee25d107e83dfadacffb7ae7635b3 Mon Sep 17 00:00:00 2001 From: portix Date: Fri, 2 Nov 2012 10:40:29 +0100 Subject: Create own this object for all scripts --- src/scripts.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/scripts.c b/src/scripts.c index dd0ae0db..1b2a7ecf 100644 --- a/src/scripts.c +++ b/src/scripts.c @@ -1969,7 +1969,9 @@ static void apply_scripts() { for (GSList *l = m_script_list; l; l=l->next) { JSObjectRef o = JSObjectMake(m_global_context, NULL, NULL); - JSObjectCallAsFunction(m_global_context, l->data, o, 0, NULL, NULL); + JSObjectRef apply = js_get_object_property(m_global_context, l->data, "apply"); + JSValueRef argv[] = {o}; + JSObjectCallAsFunction(m_global_context, apply, l->data, 1, argv, NULL); } g_slist_free(m_script_list); m_script_list = NULL; -- cgit v1.2.3