/**
* Evaluates given string as script and return if this call succeed or not.
- * On success the given **value pointer is filles with the returned string,
+ * On success the given **value pointer is filled with the returned string,
* else with the exception message. In both cases this must be freed by the
* caller if no longer used.
*/
js = g_strdup_printf("var i;for(i=0;i<[%s].length;i++);", pattern);
result = js_eval(webkit_web_frame_get_global_context(frame), js, NULL, &value);
g_free(js);
+
if (!result) {
vb_echo(VB_MSG_ERROR, true, "%s", value);
- g_free(value);
-
- return false;
}
- return true;
+ g_free(value);
+ return result;
}