Commit Graph

16 Commits

Author SHA1 Message Date
tomhuda 059a80661d * Remove legacy support for inverse sections as additional parameters.
* Unify inverse and normal block helpers
* Make Handlebars.Exception inherit from JS Error
2011-07-07 23:09:33 -07:00
Alan Johnson 37e36bf137 Merge pull request #66 from rgrove/fix-empty-array-if
The "if" block helper shouldn't treat empty arrays as truthy
2011-06-27 03:15:50 -07:00
tomhuda 60040e60fb Update specs and code so that the function passed to block helpers has the same API as regular compiled templates 2011-05-04 00:03:50 -07:00
tomhuda 81071dd22c Add VERSION constant 2011-05-03 20:39:24 -07:00
tomhuda d83e1c7484 Remove unnecessary original runtime implementation 2011-05-03 20:38:06 -07:00
tomhuda 2615fa4bd1 Add a default helperMissing to help catch errors and restore old behavior 2011-05-03 19:30:32 -07:00
Ryan Grove dec196b4d9 The "if" block helper shouldn't treat empty arrays as truthy.
Given the data {foo: []}, the following template previously considered
foo to be truthy when it shouldn't have:

    {{#if foo}}
      You should not see me!
    {{else}}
      You should see me!
    {{/if}}
2011-04-20 16:56:37 -07:00
Tim Fischbach a1b1b160cf inserting missing return statement in unless helper (fixes issue #51) 2011-03-09 11:51:00 +01:00
tomhuda 88e7003331 * Added a few public API methods to JavaScriptCompiler.prototype, so it can be subclassed.
* made it possible to define an alternate name lookup scheme (so that {{foo}} does not have to be
    context.foo, but can instead be something like context.get('foo'))
  * made it possible to substitute an alternate buffer instead of the default empty String and override how
    the compiled template appends to the buffer
* Added the concept of template-local data. In order to enable template-local data, pass true
  as the second parameter to the template compiler. Then, pass in the data as the fourth
  parameter (context, helpers, partials, data). These signatures may change before the 1.0 release.
2011-02-11 17:03:12 -08:00
Alan Johnson 40dd2c9750 Updated if helper - missed it in the last cleanup. It no longer supports methods as arguments. 2011-02-10 06:27:03 -05:00
Alan Johnson ac4d34dbe3 Backed out function helpers. 2011-01-25 21:21:57 -05:00
Raimonds Simanovskis ada5a95f9c improved "with" and "each" helpers to support function as argument 2011-01-23 11:55:48 +02:00
Alan Johnson 65b421ee4d Merged 2011-01-22 10:30:44 -05:00
wycats e20c57c9b2 Move compile to the right spot 2010-12-29 19:09:55 -08:00
wycats 5170e1459f Don't need runtime anymore for normal operation 2010-12-29 18:34:13 -08:00
wycats bf6c74aa83 Restructure things more simply 2010-12-29 18:21:43 -08:00