Skip to content
Browse files

Create new options object for unless nesting

Fixes #343
  • Loading branch information...
1 parent d6f146f commit c95b3d6fc5d250bfb8983969688d420774ce7480 @kpdecker kpdecker committed Feb 16, 2013
Showing with 3 additions and 15 deletions.
  1. +1 −5 dist/handlebars.js
  2. +1 −5 dist/handlebars.runtime.js
  3. +1 −5 lib/handlebars/base.js
View
6 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) {
View
6 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) {
View
6 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) {

0 comments on commit c95b3d6

Please sign in to comment.
Something went wrong with that request. Please try again.