Skip to content

Commit

Permalink
revert noop visitor methods
Browse files Browse the repository at this point in the history
  • Loading branch information
tj committed Nov 28, 2011
1 parent 0b9d962 commit a275555
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 17 deletions.
15 changes: 0 additions & 15 deletions lib/visitor/evaluator.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,21 +201,6 @@ Evaluator.prototype.visitPage = function(page){
return page;
};

/**
* Visit noops.
*/

Evaluator.prototype.visitString =
Evaluator.prototype.visitUnit =
Evaluator.prototype.visitRGBA =
Evaluator.prototype.visitHSLA =
Evaluator.prototype.visitNull =
Evaluator.prototype.visitComment =
Evaluator.prototype.visitBoolean =
Evaluator.prototype.visitLiteral = function(string){
return string;
};

/**
* Visit Keyframes.
*/
Expand Down
4 changes: 2 additions & 2 deletions lib/visitor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ var Visitor = module.exports = function Visitor(root) {

Visitor.prototype.visit = function(node, fn){
var method = 'visit' + node.constructor.name;
if (!this[method]) throw new Error('un-implemented ' + method);
return this[method](node);
if (this[method]) return this[method](node);
return node;
};

0 comments on commit a275555

Please sign in to comment.