Skip to content

Commit

Permalink
Use better variable name
Browse files Browse the repository at this point in the history
  • Loading branch information
kpdecker committed May 21, 2013
1 parent a97820f commit 533be69
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/handlebars/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,19 +129,19 @@ Handlebars.registerHelper('each', function(context, options) {
return ret;
});

Handlebars.registerHelper('if', function(context, options) {
var type = toString.call(context);
if(type === functionType) { context = context.call(this); }
Handlebars.registerHelper('if', function(conditional, options) {
var type = toString.call(conditional);
if(type === functionType) { conditional = conditional.call(this); }

if(!context || Handlebars.Utils.isEmpty(context)) {
if(!conditional || Handlebars.Utils.isEmpty(conditional)) {
return options.inverse(this);
} else {
return options.fn(this);
}
});

Handlebars.registerHelper('unless', function(context, options) {
return Handlebars.helpers['if'].call(this, context, {fn: options.inverse, inverse: options.fn});
Handlebars.registerHelper('unless', function(conditional, options) {
return Handlebars.helpers['if'].call(this, conditional, {fn: options.inverse, inverse: options.fn});
});

Handlebars.registerHelper('with', function(context, options) {
Expand Down

0 comments on commit 533be69

Please sign in to comment.