* then a method is called, with a string argument (json encoded)
*
*/
- void executeFile(string fname, string method, string json)
+ public void executeFile(string fname, string method, string json)
{
string file_data;
if (!FileUtils.test (fname, FileTest.EXISTS)) {
- throw new JavascriptError.MISSING_FILE(fname + " not found");
+ throw new JavascriptError.MISSING_FILE("Plugin: file not found %s", fname);
}
FileUtils.get_contents(fname, out file_data);
var jfile_data = new JSCore.String.with_utf8_c_string(file_data);
var jmethod = new JSCore.String.with_utf8_c_string(method);
- JSCore.Value json_args = new JSCore.String.with_utf8_c_string(json);
+ var json_args = new JSCore.String.with_utf8_c_string(json);
JSCore.Value ex;
throw new JavascriptError.MISSING_METHOD ("Plugin: not a method %s", method);
}
JSCore.Value[] args = {};
- args += json_args;
+ args += new JSCore.Value.string(ctx,json_args);
var res = oval.call_as_function(ctx, othis, args, out ex);