akdubya / dustjs

Asynchronous templates for the browser and node.js
http://akdubya.github.com/dustjs/
MIT License
1.44k stars 131 forks source link

Empty context array does not execute {:else} block #34

Open thejhh opened 13 years ago

thejhh commented 13 years ago

I'm not sure if this is more a feature than a bug. Please enlighten me.

The template _{#foo}x{:else}y{/foo}_ with context {"foo":[]} renders to __. Shouldn't this be _y_? Is there any other way to check if an array is empty and print a note about that?