diff options
author | Alan Johnson <alan@commondream.net> | 2011-06-27 03:15:50 -0700 |
---|---|---|
committer | Alan Johnson <alan@commondream.net> | 2011-06-27 03:15:50 -0700 |
commit | 37e36bf1371f458212db7ee45a18ed163cd329fb (patch) | |
tree | da90f35d712b0943a37bc918e92a60d4f8d364a3 /lib | |
parent | 3c2086eb2a501604c490608123c24fa3c0d25264 (diff) | |
parent | dec196b4d913cde7b5e6030ca62fc3f3457ca642 (diff) | |
download | handlebars.js-37e36bf1371f458212db7ee45a18ed163cd329fb.zip handlebars.js-37e36bf1371f458212db7ee45a18ed163cd329fb.tar.gz handlebars.js-37e36bf1371f458212db7ee45a18ed163cd329fb.tar.bz2 |
Merge pull request #66 from rgrove/fix-empty-array-if
The "if" block helper shouldn't treat empty arrays as truthy
Diffstat (limited to 'lib')
-rw-r--r-- | lib/handlebars/base.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/handlebars/base.js b/lib/handlebars/base.js index 9a75ada..b1cc4ba 100644 --- a/lib/handlebars/base.js +++ b/lib/handlebars/base.js @@ -80,7 +80,7 @@ Handlebars.registerHelper('each', function(context, fn, inverse) { }); Handlebars.registerHelper('if', function(context, fn, inverse) { - if(!context || context == []) { + if(!context || Handlebars.Utils.isEmpty(context)) { return inverse(this); } else { return fn(this); |