Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
mjackson committed Dec 6, 2012
2 parents e0edb35 + 79b08c3 commit 8296983
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mustache.js
Expand Up @@ -254,7 +254,8 @@ var Mustache;
return self.render(template, context);
};

return value.call(context.view, text, scopedRender) || "";
var result = value.call(context.view, text, scopedRender);
return result != null ? result : "";
default:
if (value) {
return callback(this, context);
Expand Down
7 changes: 7 additions & 0 deletions test/_files/check_falsy.js
@@ -0,0 +1,7 @@
({
number: function(text, render) {
return function(text, render) {
return +render(text);
}
}
})
1 change: 1 addition & 0 deletions test/_files/check_falsy.mustache
@@ -0,0 +1 @@
<p>{{#number}}0{{/number}}</p>
1 change: 1 addition & 0 deletions test/_files/check_falsy.txt
@@ -0,0 +1 @@
<p>0</p>

0 comments on commit 8296983

Please sign in to comment.