diff --git a/packages/blaze/builtins.js b/packages/blaze/builtins.js index 627bf98133..fc03136c0d 100644 --- a/packages/blaze/builtins.js +++ b/packages/blaze/builtins.js @@ -101,7 +101,7 @@ Blaze.Each = function (argFunc, contentFunc, elseFunc) { var arg = argFunc(); if (_.isObject(arg) && _.has(arg, '_sequence')) { eachView.variableName = arg._variable || null; - arg = arg._sequence(); + arg = arg._sequence; } eachView.argVar.set(arg); @@ -118,7 +118,7 @@ Blaze.Each = function (argFunc, contentFunc, elseFunc) { if (! _.isObject(item)) { item = {}; } else { - item = _.copy(item); + item = _.clone(item); } item[eachView.variableName] = _item; diff --git a/packages/spacebars-compiler/codegen.js b/packages/spacebars-compiler/codegen.js index f3a838ee83..2c506ec044 100644 --- a/packages/spacebars-compiler/codegen.js +++ b/packages/spacebars-compiler/codegen.js @@ -107,9 +107,9 @@ _.extend(CodeGen.prototype, { } // split out the variable name and sequence arguments variable = args[0][1][0];// XXX take name as a string ignoring tag - dataCode = 'function () { return { _sequence: ' + + dataCode = 'function () { return { _sequence: Spacebars.call(' + self.codeGenPath(args[2][1]) + - ', _variable: "' + variable + '" }; }'; + '), _variable: "' + variable + '" }; }'; } }