backbone.handlebars
backbone.handlebars copied to clipboard
Fix helpers with recent Handlebars and improve server-side compatibility
I believe I've discovered a fix for https://github.com/loicfrering/backbone.handlebars/issues/2 while hacking around running this module server-side tonight. It looks like Handlebars is applying the nameLookup
function to helper lookups now, generating code like this:
+ escapeExpression((helper = helpers.get ? helpers.get('view') : helpers.view || depth0.get ? depth0.get('view') : (depth0 && depth0.view),options={...
I'd guess that order of operations is causing this to have an unexpected result. Surrounding the nameLookup
output with parentheses got things working again. :)
Awesome, thanks a lot @chromakode!
In order to be merged, could you please update the according test to get a successful build on Travis CI?
Sorry, missed your reply for some reason. Will do!
Great, thanks!