summaryrefslogtreecommitdiff
path: root/src/js.c
diff options
context:
space:
mode:
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 e391abb4..eb0a118c 100644
--- a/src/js.c
+++ b/src/js.c
@@ -49,6 +49,14 @@ js_set_object_property(JSContextRef ctx, JSObjectRef arg, const char *name, cons
JSObjectSetProperty(ctx, arg, js_key, js_value, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly, exc);
JSStringRelease(js_key);
}
+gboolean
+js_object_has_property(JSContextRef ctx, JSObjectRef arg, const char *name)
+{
+ JSStringRef js_key = JSStringCreateWithUTF8CString(name);
+ gboolean result = JSObjectHasProperty(ctx, arg, js_key);
+ JSStringRelease(js_key);
+ return result;
+}
void
js_set_object_number_property(JSContextRef ctx, JSObjectRef arg, const char *name, gdouble value, JSValueRef *exc)
{