diff options
Diffstat (limited to 'src/util.c')
-rw-r--r-- | src/util.c | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -635,6 +635,13 @@ gboolean util_filename_fill_completion(GtkListStore *store, const char *input) */ char *util_js_result_as_string(WebKitJavascriptResult *result) { +#if WEBKIT_CHECK_VERSION(2, 22, 0) + JSCValue *value; + + value = webkit_javascript_result_get_js_value(result); + + return jsc_value_to_string(value); +#else JSValueRef value; JSStringRef string; size_t len; @@ -652,14 +659,23 @@ char *util_js_result_as_string(WebKitJavascriptResult *result) JSStringRelease(string); return retval; +#endif } double util_js_result_as_number(WebKitJavascriptResult *result) { +#if WEBKIT_CHECK_VERSION(2, 22, 0) + JSCValue *value; + + value = webkit_javascript_result_get_js_value(result); + + return jsc_value_to_double(value); +#else JSValueRef value = webkit_javascript_result_get_value(result); return JSValueToNumber(webkit_javascript_result_get_global_context(result), value, NULL); +#endif } /** |