return false;
}
- Gee.HashMap<int,string> ret = new Gee.HashMap<int,string> ();
+
var hash = ptype == "listener" ? node.listeners : node.props;
// untill we get a smarter renderer..
//this.dumpCode(tmpstring);
//print("offset %d\n", offset);
- this.checkStringSpawn(tmpstring );
+ return this.checkStringSpawn(tmpstring );
// modify report
}
- public void checkFileSpawn(JsRender.JsRender file )
+ public bool checkFileSpawn(JsRender.JsRender file )
{
// race condition..
if (this.compiler != null) {
- return;
+ return false;
}
this.file = file;
- this.compiler = new Spawn("/tmp", args);
- this.compiler.complete.connect(spawnResult);
try {
- this.compiler.run();
- } catch (GLib.SpawnError e) {
- var ret = new Json.Object();
- ret.set_boolean_member("success", false);
- ret.set_string_member("message", e.message);
- this.compiled(ret);
+ this.compiler = new Spawn("/tmp", args);
+ this.compiler.complete.connect(spawnResult);
+
+ this.compiler.run();
+
+
+ } catch (GLib.Error e) {
+ GLib.debug(e.message);
this.compiler = null;
- }
+ return false;
+ }
+ return true;
}
/**
* Used to compile a non builder file..
*/
- public void checkPlainFileSpawn( JsRender.JsRender file, string contents )
+ public bool checkPlainFileSpawn( JsRender.JsRender file, string contents )
{
// race condition..
if (this.compiler != null) {
- return;
+ return false;
}
var pr = (Project.Gtk)(file.project);
if (path == file.path) {
foundit = true;
break;
- }
+ }
}
if (!foundit) {
- var ret = new Json.Object();
- ret.set_boolean_member("success", true);
- ret.set_string_member("message", "no need to compile");
- this.compiled(ret);
+
this.compiler = null;
- return; // do not run the compile..
+ return false; // do not run the compile..
}
// is the file in the module?
args += file.path;
- this.compiler = new Spawn("/tmp", args);
- this.compiler.complete.connect(spawnResult);
+
try {
+ this.compiler = new Spawn("/tmp", args);
+ this.compiler.complete.connect(spawnResult);
this.compiler.run();
- } catch (GLib.SpawnError e) {
- var ret = new Json.Object();
- ret.set_boolean_member("success", false);
- ret.set_string_member("message", e.message);
- this.compiled(ret);
+ } catch (GLib.Error e) {
+
this.compiler = null;
+ return false;
}
+ return true;
}
this.compiled(ret);
- } catch (Error e) {
+ } catch (GLib.Error e) {
var ret = new Json.Object();
ret.set_boolean_member("success", false);
ret.set_string_member("message", e.message);