summaryrefslogtreecommitdiff
path: root/src/js.c
diff options
context:
space:
mode:
authorportix <none@none>2012-06-03 23:44:32 +0200
committerportix <none@none>2012-06-03 23:44:32 +0200
commit80ac1b30b111ae528f9e529410f0d45dc8076410 (patch)
tree193026ce0362ebd88d321796f010c0fdd19d1e8c /src/js.c
parent64321ca7aac7c02b2b2c1da6c3aca601799270d2 (diff)
downloaddwb-80ac1b30b111ae528f9e529410f0d45dc8076410.zip
New function system.spawnSync
Diffstat (limited to 'src/js.c')
-rw-r--r--src/js.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/js.c b/src/js.c
index 1ba5fa7b..ce90cd51 100644
--- a/src/js.c
+++ b/src/js.c
@@ -39,6 +39,13 @@ 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);
}
+void
+js_set_object_number_property(JSContextRef ctx, JSObjectRef arg, const char *name, gdouble value, JSValueRef *exc) {
+ JSStringRef js_key = JSStringCreateWithUTF8CString(name);
+ JSValueRef js_value = JSValueMakeNumber(ctx, value);
+ JSObjectSetProperty(ctx, arg, js_key, js_value, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly, exc);
+ JSStringRelease(js_key);
+}
/* js_get_object_property {{{*/
JSObjectRef
js_get_object_property(JSContextRef ctx, JSObjectRef arg, const char *name) {