r105283 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r105282‎ | r105283 | r105284 >
Date:10:23, 6 December 2011
Author:hashar
Status:ok
Tags:
Comment:
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.
Modified paths:
  • /trunk/extensions/VisualEditor/tests/parser/parserTests.js (modified) (history)

Diff [purge]

Index: trunk/extensions/VisualEditor/tests/parser/parserTests.js
@@ -18,6 +18,7 @@
1919 path = require('path'),
2020 jsDiff = require('diff'),
2121 colors = require('colors'),
 22+ util = require( 'util' ),
2223 HTML5 = require('html5').HTML5;
2324
2425 // Name of file used to cache the parser tests cases
@@ -386,7 +387,9 @@
387388 });
388389 //var res = es.HtmlSerializer.stringify(tokens,environment);
389390 //console.log(JSON.stringify(tokens));
390 -
 391+ //Slightly better token output debugging:
 392+ //console.log( util.inspect( tokens, false, null ).yellow);
 393+
391394 // Build a DOM tree from tokens using the HTML tree
392395 // builder/parser.
393396 processTokens(tokens, tokenizer);

Status & tagging log