seed r801 - in trunk: doc/reference tests/javascript tools



Author: hortont
Date: Sun Jan 25 09:03:51 2009
New Revision: 801
URL: http://svn.gnome.org/viewvc/seed?rev=801&view=rev

Log:
Many of the tests now pass JSLint.



Modified:
   trunk/doc/reference/seed-docs.sgml
   trunk/tests/javascript/closure-finalization.js
   trunk/tests/javascript/function-info.js
   trunk/tests/javascript/gerror.js
   trunk/tests/javascript/gtype-signal-args.js
   trunk/tests/javascript/gtype-signal.js
   trunk/tests/javascript/gtype.js
   trunk/tests/javascript/namespace-exception-test.js
   trunk/tests/javascript/native-closure-exception.js
   trunk/tests/javascript/native-closure.js
   trunk/tests/javascript/out-test.js
   trunk/tests/javascript/sqlite.js
   trunk/tests/javascript/struct-union-enumerate.js
   trunk/tests/javascript/type-conversion.js
   trunk/tools/jslint.js
   trunk/tools/run-lint.js

Modified: trunk/doc/reference/seed-docs.sgml
==============================================================================
--- trunk/doc/reference/seed-docs.sgml	(original)
+++ trunk/doc/reference/seed-docs.sgml	Sun Jan 25 09:03:51 2009
@@ -12,7 +12,7 @@
   </bookinfo>
 
   <chapter>
-    <title>[Seed External API]</title>
+    <title>Seed External API</title>
     <xi:include href="xml/seed.xml"/>
   </chapter>
 </book>

Modified: trunk/tests/javascript/closure-finalization.js
==============================================================================
--- trunk/tests/javascript/closure-finalization.js	(original)
+++ trunk/tests/javascript/closure-finalization.js	Sun Jan 25 09:03:51 2009
@@ -11,8 +11,8 @@
 // Closure will always be GCed at end of signal.
 signal = function()
 {
-	w.foreach(function(widget){Seed.print(widget)});
-}
+	w.foreach(function(widget){Seed.print(widget);});
+};
 
 vbox = new Gtk.VBox();
 

Modified: trunk/tests/javascript/function-info.js
==============================================================================
--- trunk/tests/javascript/function-info.js	(original)
+++ trunk/tests/javascript/function-info.js	Sun Jan 25 09:03:51 2009
@@ -6,6 +6,6 @@
 Seed.import_namespace("Gtk");
 Seed.import_namespace("GIRepository");
 
-f = Gtk.Window.prototype.resize.info
+f = Gtk.Window.prototype.resize.info;
 
 Seed.print(GIRepository.base_info_get_name(f));

Modified: trunk/tests/javascript/gerror.js
==============================================================================
--- trunk/tests/javascript/gerror.js	(original)
+++ trunk/tests/javascript/gerror.js	Sun Jan 25 09:03:51 2009
@@ -7,7 +7,9 @@
 // STDIN:
 // STDOUT:
 // STDERR:
-Seed.import_namespace("Gio")
+
+Seed.import_namespace("Gio");
+
 try
 {
 	Gio.simple_write(".", "test");

Modified: trunk/tests/javascript/gtype-signal-args.js
==============================================================================
--- trunk/tests/javascript/gtype-signal-args.js	(original)
+++ trunk/tests/javascript/gtype-signal-args.js	Sun Jan 25 09:03:51 2009
@@ -18,7 +18,7 @@
                                      return_type: Gtk.Window.type};
 
         hello_signal_id = klass.install_signal(HelloSignalDefinition);
-    },
+    }
 });
 
 w = new HelloWindow();
@@ -26,7 +26,7 @@
 w.signal.hello.connect(function(object, number, string)
                        {
                            Seed.print(number + " " + string);
-                           return new Gtk.Window()
+                           return new Gtk.Window();
                        });
 
 Seed.print(w.signal.hello.emit(2, "Test"));

Modified: trunk/tests/javascript/gtype-signal.js
==============================================================================
--- trunk/tests/javascript/gtype-signal.js	(original)
+++ trunk/tests/javascript/gtype-signal.js	Sun Jan 25 09:03:51 2009
@@ -26,8 +26,8 @@
 HelloWindow = new GType(HelloWindowType);
 w = new HelloWindow();
 
-w.signal.hello.connect(function(){Seed.print("Hello")});
-w.signal.goodbye.connect(function(){Seed.print("Goodbye")});
+w.signal.hello.connect(function(){Seed.print("Hello");});
+w.signal.goodbye.connect(function(){Seed.print("Goodbye");});
 
 w.signal.hello.emit();
 w.signal.goodbye.emit();

Modified: trunk/tests/javascript/gtype.js
==============================================================================
--- trunk/tests/javascript/gtype.js	(original)
+++ trunk/tests/javascript/gtype.js	Sun Jan 25 09:03:51 2009
@@ -12,23 +12,22 @@
     name: "HelloWindow",
     class_init: function(klass, prototype)
     {
-	prototype.message = "Prototypes!";
-	Seed.print("In klass init");
+        prototype.message = "Prototypes!";
+        Seed.print("In klass init");
     },
     init: function(klass)
     {
-	this.title = "Hello!";
-	Seed.print("In constructor for " + this);
+        this.title = "Hello!";
+        Seed.print("In constructor for " + this);
     }};
 
 HelloWindow = new GType(HelloWindowType);
 w = new HelloWindow();
 Seed.print(w.message);
 w.signal.map.connect(
-		     function(widget)
-		     {
-			 Seed.print("In map, verifying widget.title : " 
-				    + widget.title)
-		     });
+             function(widget)
+             {
+                 Seed.print("In map, verifying widget.title : " + widget.title);
+             });
 w.show();
-	  
+      

Modified: trunk/tests/javascript/namespace-exception-test.js
==============================================================================
--- trunk/tests/javascript/namespace-exception-test.js	(original)
+++ trunk/tests/javascript/namespace-exception-test.js	Sun Jan 25 09:03:51 2009
@@ -3,10 +3,7 @@
 // STDIN:
 // STDOUT:Typelib file for namespace 'CoreAnimation' \(any version\) not found\nTypelib file for namespace 'Gtk', version '3\.0' not found
 // STDERR:
-// Returns: 0
-// STDIN:
-// STDOUT:No such namespace: CoreAnimation\nNo such namespace: Gtk \(version 3\.0\)
-// STDERR:
+
 try
 {
 	Seed.import_namespace("CoreAnimation");
@@ -23,4 +20,4 @@
 catch(e)
 {
 	Seed.print(e.message);
-}
\ No newline at end of file
+}

Modified: trunk/tests/javascript/native-closure-exception.js
==============================================================================
--- trunk/tests/javascript/native-closure-exception.js	(original)
+++ trunk/tests/javascript/native-closure-exception.js	Sun Jan 25 09:03:51 2009
@@ -3,13 +3,14 @@
 // STDIN:
 // STDOUT:
 // STDERR:\n\*\* \(seed:[0-9]+\): WARNING \*\*: Exception in closure marshal\. Line 11 in .*\/native-closure-exception\.js: ReferenceError Can't find variable: a
-Seed.import_namespace("Gtk")
+
+Seed.import_namespace("Gtk");
 Gtk.init(null, null);
 
 w = new Gtk.Window();
 vbox = new Gtk.VBox();
 
-closure = function(widget){a.a.a};
+closure = function(widget){a.a.a;};
 w.add(vbox);
 
 vbox.pack_start(new Gtk.Label());

Modified: trunk/tests/javascript/native-closure.js
==============================================================================
--- trunk/tests/javascript/native-closure.js	(original)
+++ trunk/tests/javascript/native-closure.js	Sun Jan 25 09:03:51 2009
@@ -3,13 +3,14 @@
 // STDIN:
 // STDOUT:\[object GtkLabel\]\n\[object GtkButton\]
 // STDERR:
-Seed.import_namespace("Gtk")
+
+Seed.import_namespace("Gtk");
 Gtk.init(null, null);
 
 w = new Gtk.Window();
 vbox = new Gtk.VBox();
 
-closure = function(widget){Seed.print(widget)};
+closure = function(widget){Seed.print(widget);};
 w.add(vbox);
 
 vbox.pack_start(new Gtk.Label());

Modified: trunk/tests/javascript/out-test.js
==============================================================================
--- trunk/tests/javascript/out-test.js	(original)
+++ trunk/tests/javascript/out-test.js	Sun Jan 25 09:03:51 2009
@@ -3,11 +3,13 @@
 // STDIN:
 // STDOUT:5 100
 // STDERR:
+
 Seed.import_namespace("Gtk");
-Gtk.init(null, null)
+Gtk.init(null, null);
+
 w = new Gtk.Window({width_request: 5, height_request: 100});
-o1 = new Object();
-o2 = new Object();
+o1 = { };
+o2 = { };
 
 w.get_size_request(o1, o2);
 Seed.print(o1.value + " " +  o2.value);

Modified: trunk/tests/javascript/sqlite.js
==============================================================================
--- trunk/tests/javascript/sqlite.js	(original)
+++ trunk/tests/javascript/sqlite.js	Sun Jan 25 09:03:51 2009
@@ -10,7 +10,10 @@
 try
 {
 	Gio.file_new_for_path("/tmp/.seed_test.db")["delete"]();
-} catch(e) { }
+}
+catch(e)
+{
+}
 
 d = new sqlite.Database("/tmp/.seed_test.db");
 
@@ -19,6 +22,6 @@
 d.exec("insert into t1 (data,num) values ('More sample data',6);");
 d.exec("insert into t1 (data,num) values ('And a little more',9);");
 
-d.exec("select * from t1", function(results){Seed.print(JSON.stringify(results))});
+d.exec("select * from t1", function(results){Seed.print(JSON.stringify(results));});
 
 d.close();

Modified: trunk/tests/javascript/struct-union-enumerate.js
==============================================================================
--- trunk/tests/javascript/struct-union-enumerate.js	(original)
+++ trunk/tests/javascript/struct-union-enumerate.js	Sun Jan 25 09:03:51 2009
@@ -14,7 +14,7 @@
 	for (prop in e)
 	{
 		Seed.print(indent + "* " + prop);
-		if (e[prop] != null && (e[prop].toString().search("struct") > 0 ||
+		if (e[prop] !== null && (e[prop].toString().search("struct") > 0 ||
 								e[prop].toString().search("union") > 0))
 			enum_structlike(indent + "   ", e[prop]);
 	}
@@ -22,4 +22,4 @@
 
 e = new Gdk.Event();
 
-enum_structlike("", e);
\ No newline at end of file
+enum_structlike("", e);

Modified: trunk/tests/javascript/type-conversion.js
==============================================================================
--- trunk/tests/javascript/type-conversion.js	(original)
+++ trunk/tests/javascript/type-conversion.js	Sun Jan 25 09:03:51 2009
@@ -18,11 +18,11 @@
 {
 	try
 	{
-		eval(tests[i])
+		eval(tests[i]);
 	}
 	catch (e)
 	{
 		Seed.print(e.message);
 	}
 	
-}
\ No newline at end of file
+}

Modified: trunk/tools/jslint.js
==============================================================================
--- trunk/tools/jslint.js	(original)
+++ trunk/tools/jslint.js	Sun Jan 25 09:03:51 2009
@@ -653,7 +653,7 @@
             String              : true,
             SyntaxError         : true,
             TypeError           : true,
-            URIError            : true
+            URIError            : true,
         },
 
         standard_member = {

Modified: trunk/tools/run-lint.js
==============================================================================
--- trunk/tools/run-lint.js	(original)
+++ trunk/tools/run-lint.js	Sun Jan 25 09:03:51 2009
@@ -10,13 +10,12 @@
 
 	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;
 	
+	Seed.print("################################################################################");
+	Seed.print("            " + filename);
+	
 	for(no in JSLINT.errors)
 	{
 		var err = JSLINT.errors[no];
@@ -30,4 +29,8 @@
 	return JSLINT.errors.length;
 }
 
-runLint("run-lint.js");
+for(a in Seed.argv)
+{
+	if(a >= 2)
+		runLint(Seed.argv[a]);
+}



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