summaryrefslogtreecommitdiff
path: root/src/js.c
diff options
context:
space:
mode:
authorportix <portix@gmx.net>2012-12-07 17:07:31 +0100
committerportix <portix@gmx.net>2012-12-07 17:07:31 +0100
commit7b2ea8073aea6ab4a5d593d8be8bed923b6329fb (patch)
tree49c88ebc0e305a16139b1101376442f69dbd24d3 /src/js.c
parent6d228d4ff707158db60197592d7b231737f890c3 (diff)
downloaddwb-7b2ea8073aea6ab4a5d593d8be8bed923b6329fb.zip
Implementing Deferreds
Diffstat (limited to 'src/js.c')
-rw-r--r--src/js.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/js.c b/src/js.c
index c1a2a85d..e69a5ecf 100644
--- a/src/js.c
+++ b/src/js.c
@@ -332,4 +332,12 @@ js_array_iterator_next(js_array_iterator *iter, JSValueRef *exc)
return JSObjectGetPropertyAtIndex(iter->ctx, iter->array, iter->current_index++, exc);
}
+JSObjectRef
+js_value_to_function(JSContextRef ctx, JSValueRef val, JSValueRef *exc)
+{
+ JSObjectRef ret = JSValueToObject(ctx, val, exc);
+ if (ret != NULL && JSObjectIsFunction(ctx, ret))
+ return ret;
+ return NULL;
+}