seed r800 - trunk/tools



Author: hortont
Date: Sun Jan 25 08:32:37 2009
New Revision: 800
URL: http://svn.gnome.org/viewvc/seed?rev=800&view=rev

Log:
JSLint works with Seed code now, mostly! Rev 800!


Modified:
   trunk/tools/jslint.js
   trunk/tools/run-lint.js

Modified: trunk/tools/jslint.js
==============================================================================
--- trunk/tools/jslint.js	(original)
+++ trunk/tools/jslint.js	Sun Jan 25 08:32:37 2009
@@ -1808,8 +1808,9 @@
                 }
                 break;
             default:
-                warning("Line breaking error '{a}'.",
-                        token, token.value);
+                // TIMTIMTIM
+                //warning("Line breaking error '{a}'.",
+                //        token, token.value);
             }
         }
     }
@@ -2368,8 +2369,9 @@
             }
             advance('}', t);
         } else {
-            warning("Expected '{a}' and instead saw '{b}'.",
-                    nexttoken, '{', nexttoken.value);
+            // TIMTIMTIM
+            //warning("Expected '{a}' and instead saw '{b}'.",
+            //        nexttoken, '{', nexttoken.value);
             noreach = true;
             a = [statement()];
             noreach = false;
@@ -4430,7 +4432,8 @@
             s = block(true);
             if (!option.forin && (s.length > 1 || typeof s[0] !== 'object' ||
                     s[0].value !== 'if')) {
-                warning("The body of a for in should be wrapped in an if statement to filter unwanted properties from the prototype.", this);
+                // TIMTIMTIM
+                //warning("The body of a for in should be wrapped in an if statement to filter unwanted properties from the prototype.", this);
             }
             funct['(breakage)'] -= 1;
             funct['(loopage)'] -= 1;

Modified: trunk/tools/run-lint.js
==============================================================================
--- trunk/tools/run-lint.js	(original)
+++ trunk/tools/run-lint.js	Sun Jan 25 08:32:37 2009
@@ -4,17 +4,30 @@
 
 Seed.include("jslint.js");
 
-var read_file = Gio.simple_read("run-lint.js");
-read_file = read_file.replace("#!/usr/bin/env seed","");
-Seed.print(read_file);
-
-if(JSLINT(read_file, {white:false, passfail: false}) == 0)
+function runLint(filename)
 {
+	var read_file = Gio.simple_read(filename);
+
+	read_file = read_file.replace("#!/usr/bin/env seed","");
+	
+	Seed.print("=====================================");
+	Seed.print("    " + filename);
+	Seed.print("=====================================");
+
+	if(JSLINT(read_file, {white:false, passfail: false, eqeqeq: false, forin: false}))
+		return;
+	
 	for(no in JSLINT.errors)
 	{
-		if(!JSLINT.errors[no])
+		var err = JSLINT.errors[no];
+	
+		if(!err || !err.reason)
 			continue;
-			
-		Seed.print(JSLINT.errors[no].reason);
+	
+		Seed.printf("%d:%d\t%s",err.line,err.character,err.reason);
 	}
+	
+	return JSLINT.errors.length;
 }
+
+runLint("run-lint.js");



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]