script to detect active console.log calls and mods to avoid false positives
authorMatteo Nastasi (mop) <nastasi@alternativeoutput.it>
Tue, 9 Jul 2013 05:40:32 +0000 (07:40 +0200)
committerMatteo Nastasi (mop) <nastasi@alternativeoutput.it>
Tue, 9 Jul 2013 05:40:32 +0000 (07:40 +0200)
bin/console_log_list.sh [new file with mode: 0755]
web/commons.js
web/myconsole.js
web/xynt-streaming.js

diff --git a/bin/console_log_list.sh b/bin/console_log_list.sh
new file mode 100755 (executable)
index 0000000..c312dc6
--- /dev/null
@@ -0,0 +1,2 @@
+#!/bin/bash
+grep -r console.log web/* | grep -v ': *//' | grep -v '// OK$' | grep -v '/* console.log'
index be7cac3..4c0dbcf 100644 (file)
@@ -281,9 +281,9 @@ function send_mesg(mesg)
     xhr_wr.setRequestHeader("If-Modified-Since", new Date().toUTCString());
     xhr_wr.onreadystatechange = function() { return; };
     if (typeof(g_debug) == 'number' && g_debug > 0
-        && typeof(console) == 'object' && typeof(console.log) == 'function') {
+        && typeof(console) == 'object' && typeof(console.log) == 'function') { // OK
             var ldate = new Date();
-            console.log(ldate.getTime()+':MESG:'+mesg);
+            console.log(ldate.getTime()+':MESG:'+mesg); // OK
     }
     xhr_wr.send(null);
 
index 223abdc..170220a 100644 (file)
@@ -114,7 +114,7 @@ function log_walk(curtag)
     var ind = 0;
     var ancestor = curtag;
     do {
-        console.log(spcs("_", "+", ind)+" ["+curtag.tagName+"]  nodeType: "+curtag.nodeType+" inner: ["+curtag.innerHTML+"]");
+        console.log(spcs("_", "+", ind)+" ["+curtag.tagName+"]  nodeType: "+curtag.nodeType+" inner: ["+curtag.innerHTML+"]"); // OK
         if (curtag.firstChild != null && curtag.tagName != "TD") {
             ind += 2;
             curtag = curtag.firstChild;
index 11f4f22..79159be 100644 (file)
@@ -730,7 +730,7 @@ xynt_streaming.prototype = {
 
     log: function (s) {
         if (this.console != null) {
-            return (this.console.log(s));
+            return (this.console.log(s)); // OK
         }
     }
 }