start fixing Spacebars tests

This commit is contained in:
David Greenspan
2013-10-02 15:17:40 -07:00
parent 8f75185fea
commit 165594c239
2 changed files with 8 additions and 6 deletions

View File

@@ -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 : '') + '}';
};

View File

@@ -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}}>',