Create new options object for unless nesting

Fixes #343
This commit is contained in:
kpdecker
2013-02-16 16:18:48 -06:00
parent d6f146f8a5
commit c95b3d6fc5
3 changed files with 3 additions and 15 deletions
+1 -5
View File
@@ -152,11 +152,7 @@ Handlebars.registerHelper('if', function(context, options) {
});
Handlebars.registerHelper('unless', function(context, options) {
var fn = options.fn, inverse = options.inverse;
options.fn = inverse;
options.inverse = fn;
return Handlebars.helpers['if'].call(this, context, options);
return Handlebars.helpers['if'].call(this, context, {fn: options.inverse, inverse: options.fn});
});
Handlebars.registerHelper('with', function(context, options) {
+1 -5
View File
@@ -152,11 +152,7 @@ Handlebars.registerHelper('if', function(context, options) {
});
Handlebars.registerHelper('unless', function(context, options) {
var fn = options.fn, inverse = options.inverse;
options.fn = inverse;
options.inverse = fn;
return Handlebars.helpers['if'].call(this, context, options);
return Handlebars.helpers['if'].call(this, context, {fn: options.inverse, inverse: options.fn});
});
Handlebars.registerHelper('with', function(context, options) {
+1 -5
View File
@@ -129,11 +129,7 @@ Handlebars.registerHelper('if', function(context, options) {
});
Handlebars.registerHelper('unless', function(context, options) {
var fn = options.fn, inverse = options.inverse;
options.fn = inverse;
options.inverse = fn;
return Handlebars.helpers['if'].call(this, context, options);
return Handlebars.helpers['if'].call(this, context, {fn: options.inverse, inverse: options.fn});
});
Handlebars.registerHelper('with', function(context, options) {