2011-11-18 13:57:07 +00:00
|
|
|
var HTML5 = require('../html5');
|
2012-06-05 21:32:26 +00:00
|
|
|
var util = require('util');
|
2011-11-18 13:57:07 +00:00
|
|
|
|
|
|
|
var debugFlags = {any: true}
|
|
|
|
|
|
|
|
HTML5.debug = function() {
|
2012-06-05 21:32:26 +00:00
|
|
|
var section = arguments[0];
|
2011-11-18 13:57:07 +00:00
|
|
|
if(debugFlags[section] || debugFlags[section.split('.')[0]]) {
|
|
|
|
var out = [];
|
|
|
|
for(var i in arguments) {
|
|
|
|
out.push(arguments[i])
|
|
|
|
}
|
2012-06-05 21:32:26 +00:00
|
|
|
console.log(util.inspect(out, false, 3))
|
2011-11-18 13:57:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
HTML5.enableDebug = function(section) {
|
|
|
|
debugFlags[section] = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
HTML5.disableDebug = function(section) {
|
|
|
|
debugFlags[section] = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
HTML5.dumpTagStack = function(tags) {
|
|
|
|
var r = [];
|
2012-06-05 21:32:26 +00:00
|
|
|
for(var i in tags) {
|
2011-11-18 13:57:07 +00:00
|
|
|
r.push(tags[i].tagName);
|
|
|
|
}
|
|
|
|
return r.join(', ');
|
|
|
|
}
|