From de0ce854e27426cd641e6041d821a03da188706a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Nes=CC=8Cetr=CC=8Cil?= Date: Tue, 28 Aug 2012 20:19:44 +0200 Subject: [PATCH] Fixed :else in section when iterating over empty array. The "No friends" 101 example from dust documentation was actually not working --- lib/dust.js | 18 +++++++++++------- test/jasmine-test/spec/grammarTests.js | 7 +++++++ test/test.html | 1 + 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/lib/dust.js b/lib/dust.js index e5341a16..b954a3ed 100644 --- a/lib/dust.js +++ b/lib/dust.js @@ -390,14 +390,18 @@ Chunk.prototype.section = function(elem, context, bodies, params) { if (dust.isArray(elem)) { if (body) { var len = elem.length, chunk = this; - context.stack.head['$len'] = len; - for (var i=0; i 0) { + context.stack.head['$len'] = len; + for (var i=0; i{dust} + or write your own: