Skip to content

Commit

Permalink
started work on the ascii view
Browse files Browse the repository at this point in the history
  • Loading branch information
ibolmo committed Nov 14, 2009
1 parent d149441 commit df3bc59
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions asciiview.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/**
* @fileoverview A simple (ascii) view of the executed JavaScript.
* @author ibolmo@gmail.com (Olmo Maldonado)
* @requires Injectigator
*/

/**
* Creates an ASCII representation of the executed nodes.
*
* Output Example:
* ┐
* ├ anon, 2 ms
* ├ helloWorld, 100 ms ┐
* ├ anon, 1 ms
* ╟ anon (10, delayed), 5 ms ┐
* ├ doSomething, 100 ms
* ╠ log (periodical), 10 ms
* ├ anon (210), 10 ms
* ┘
*
* @param {Object} opt_root An optional root to use instead the global
* Injectigator root.
* @constructor
*/
(function(){

var AsciiView = Injectigator.AsciiView = function(opt_root) {
var root = opt_root || Injectigator.ROOT;

/**
* String buffer. Each element is a row.
* @type {Array.<string>}
* @private
*/
this.buffer_ = ['ROOT'];
this.lineLength = this.buffer[0].length;
this.length = 1;
this.parseNode(root);
};


/**
* Map of Ascii symbols used by the View.
* @type {Object}
*/
AsciiView.SymbolType = {
START: '\u2510',
END: '\u2518',
NODE: '\u251C',
DELAYED: '\u255F',
PERIODICAL: '\u2560'
};


AsciiView.prototype.parseNode = function(node) {

};

})();

0 comments on commit df3bc59

Please sign in to comment.