Browse files

using functions in each expressions

  • Loading branch information...
1 parent 8b87161 commit fd643bf46b1e318214beaaa89dd7063983cf0f98 @disfated committed Dec 10, 2011
Showing with 3 additions and 0 deletions.
  1. +3 −0 lib/visitor/evaluator.js
View
3 lib/visitor/evaluator.js
@@ -251,6 +251,8 @@ Evaluator.prototype.visitFunction = function(fn){
*/
Evaluator.prototype.visitEach = function(each){
+ var _ = this.return;
+ this.return = true;
var expr = utils.unwrap(this.visit(utils.unwrap(each.expr)))
, len = expr.nodes.length
, val = new nodes.Ident(each.val)
@@ -259,6 +261,7 @@ Evaluator.prototype.visitEach = function(each){
, block = this.currentBlock
, vals = []
, body;
+ this.return = _;
each.block.scope = false;
for (var i = 0; i < len; ++i) {

0 comments on commit fd643bf

Please sign in to comment.