src/Builder4/Editor.bjs
[app.Builder.js] / src / Palete / Palete.vala
index 1399a11..239862a 100644 (file)
@@ -365,14 +365,13 @@ namespace Palete
                                        string code, 
                                        string property, 
                                        string ptype,
-                                       JsRender.JsRender file,
-                                       JsRender.Node? node, 
+                                       JsRender.JsRender file, 
                                        out Gee.HashMap<int,string> errors
                                 ) 
                {   
 
                         print("validate code (%s) ptype=%s property=%s\n", file.language, ptype, property);
-                          errors = new Gee.HashMap<int,string>();
+                       errors = new Gee.HashMap<int,string>();
                
                        if (file.language != "js") {
                                return false;
@@ -415,14 +414,14 @@ namespace Palete
                        
                        
                        if (ptype == "file") {
-                                this.validateJavascriptCompression(file, state, code);
+                                return this.javascriptHasCompressionErrors(file, state, code);
                        }
                        print("no errors\n");
-                       return ret;
+                       return false;
                          
                } 
                
-               public void  validateJavascriptCompression(JsRender.JsRender file, WindowState state, string code)
+               public bool  javascriptHasCompressionErrors(JsRender.JsRender file, WindowState state, string code)
                {
                        // this uses the roojspacker code to try and compress the code.
                        // it should highlight errors before we actually push live the code.
@@ -438,6 +437,10 @@ namespace Palete
                         
                        p.packFile(code, file.path,"");
                        state.showCompileResult(p.result);
+                       if (p.hasErrors("")) {
+                               return true;
+                       }
+                       return false;