mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
start fixing Spacebars tests
This commit is contained in:
@@ -925,7 +925,7 @@ Spacebars.compile = function (inputString, options) {
|
||||
(funcInfo.usedSelf ?
|
||||
'\n' + indent + 'var self = this;' : '') +
|
||||
'\n' + indent + 'buf.write(' +
|
||||
renderables.join(',\n' + indent) + ');\n' +
|
||||
renderables.join(',\n' + indent + ' ') + ');\n' +
|
||||
oldIndent : '') + '}';
|
||||
};
|
||||
|
||||
|
||||
@@ -349,22 +349,24 @@ Tinytest.add("spacebars - compiler", function (test) {
|
||||
run('abc',
|
||||
|
||||
'function (buf) {',
|
||||
' buf.text("abc");',
|
||||
' buf.write("abc");',
|
||||
'}');
|
||||
|
||||
run('<a foo=bar>abc</a>',
|
||||
|
||||
'function (buf) {',
|
||||
' buf.openTag("a", {"foo": "bar"});',
|
||||
' buf.text("abc");',
|
||||
' buf.closeTag("a");',
|
||||
' buf.write("<a",',
|
||||
' {attrs: {"foo": "bar"}},',
|
||||
' ">abc</a>");',
|
||||
'}');
|
||||
|
||||
run('<a foo={{bar}}>',
|
||||
|
||||
'function (buf) {',
|
||||
' var self = this;',
|
||||
' buf.openTag("a", {"foo": function () { return String(Spacebars.call(self.lookup("bar")) || ""); }});',
|
||||
' buf.write("<a",',
|
||||
' {attrs: function () { return {"foo": Spacebars.call(self.lookup("bar"))}; }},',
|
||||
' ">");',
|
||||
'}');
|
||||
|
||||
run('<a foo={{bar.baz}}>',
|
||||
|
||||
Reference in New Issue
Block a user