diff --git a/dist/handlebars.js b/dist/handlebars.js index 3cfb57d4c..39afa6419 100644 --- a/dist/handlebars.js +++ b/dist/handlebars.js @@ -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) { diff --git a/dist/handlebars.runtime.js b/dist/handlebars.runtime.js index c604a21e1..a55b30fd4 100644 --- a/dist/handlebars.runtime.js +++ b/dist/handlebars.runtime.js @@ -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) { diff --git a/lib/handlebars/base.js b/lib/handlebars/base.js index a5fbeed48..dcbd95889 100644 --- a/lib/handlebars/base.js +++ b/lib/handlebars/base.js @@ -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) {