mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-25 06:46:26 +00:00
59fc634cce
Change-Id: I321d9a58ea1af33842a606fc8706938093a8330f
32 lines
608 B
JavaScript
32 lines
608 B
JavaScript
var HTML5 = require('../html5');
|
|
var util = require('util');
|
|
|
|
var debugFlags = {any: true}
|
|
|
|
HTML5.debug = function() {
|
|
var section = arguments[0];
|
|
if(debugFlags[section] || debugFlags[section.split('.')[0]]) {
|
|
var out = [];
|
|
for(var i in arguments) {
|
|
out.push(arguments[i])
|
|
}
|
|
console.log(util.inspect(out, false, 3))
|
|
}
|
|
}
|
|
|
|
HTML5.enableDebug = function(section) {
|
|
debugFlags[section] = true;
|
|
}
|
|
|
|
HTML5.disableDebug = function(section) {
|
|
debugFlags[section] = false;
|
|
}
|
|
|
|
HTML5.dumpTagStack = function(tags) {
|
|
var r = [];
|
|
for(var i in tags) {
|
|
r.push(tags[i].tagName);
|
|
}
|
|
return r.join(', ');
|
|
}
|