mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Generate Spacebars.call instead of calling the function manually
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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 + '" }; }';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user