summaryrefslogtreecommitdiff
path: root/src/js.c
diff options
context:
space:
mode:
authorportix <none@none>2012-04-17 01:53:50 +0200
committerportix <none@none>2012-04-17 01:53:50 +0200
commit724b3b4812f8d19eb684667e7ea5842a82280fc8 (patch)
tree534e657caaaa84bbdde544550da9dc962a0efd06 /src/js.c
parent4202f035d34004b9f555b4066e18ad16ec17b924 (diff)
downloaddwb-724b3b4812f8d19eb684667e7ea5842a82280fc8.zip
Basic setter/getter functions in scripts
--HG-- branch : scripts
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 41cd6427..0cb79d03 100644
--- a/src/js.c
+++ b/src/js.c
@@ -40,6 +40,13 @@ js_get_object_property(JSContextRef ctx, JSObjectRef arg, const char *name) {
}/*}}}*/
+JSValueRef
+js_char_to_value(JSContextRef ctx, const char *text) {
+ JSStringRef string = JSStringCreateWithUTF8CString(text);
+ JSValueRef ret = JSValueMakeString(ctx, string);
+ JSStringRelease(string);
+ return ret;
+}
/* js_get_string_property {{{*/
char *
js_get_string_property(JSContextRef ctx, JSObjectRef arg, const char *name) {