util.inspect to dump tokens

It gets a better output over JSON.stringify since inspect nicely indent
the object/array dump. Makes it easier to read for humans.
This commit is contained in:
Antoine Musso 2011-12-06 10:23:58 +00:00
parent dbe4890ed6
commit 350d1e8978

View file

@ -18,6 +18,7 @@ var fs = require('fs'),
path = require('path'),
jsDiff = require('diff'),
colors = require('colors'),
util = require( 'util' ),
HTML5 = require('html5').HTML5;
// Name of file used to cache the parser tests cases
@ -386,7 +387,9 @@ function processTest(item) {
});
//var res = es.HtmlSerializer.stringify(tokens,environment);
//console.log(JSON.stringify(tokens));
//Slightly better token output debugging:
//console.log( util.inspect( tokens, false, null ).yellow);
// Build a DOM tree from tokens using the HTML tree
// builder/parser.
processTokens(tokens, tokenizer);