Skip to content

Commit

Permalink
Simplify program generation logic
Browse files Browse the repository at this point in the history
  • Loading branch information
kpdecker committed Nov 8, 2014
1 parent d47e4dd commit d595ebc
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions lib/handlebars/compiler/javascript-compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -870,16 +870,8 @@ JavaScriptCompiler.prototype = {
// Avoid setting fn and inverse if neither are set. This allows
// helpers to do a check for `if (options.fn)`
if (program || inverse) {
if (!program) {
program = 'this.noop';
}

if (!inverse) {
inverse = 'this.noop';
}

options.fn = program;
options.inverse = inverse;
options.fn = program || 'this.noop';
options.inverse = inverse || 'this.noop';
}

// The parameters go on to the stack in order (making sure that they are evaluated in order)
Expand Down

0 comments on commit d595ebc

Please sign in to comment.