cannot use multiple subexpressions in the options hash #748

jenseng opened this Issue Feb 20, 2014 · 3 comments


None yet

3 participants

jenseng commented Feb 20, 2014

if you attempt to use the same helper more than once within an options hash (via subexpressions), the value from the last call gets used for all of them. here's a simple jsfiddle illustrating the problem. note that it's only broken for the options hash; it works correctly for arguments.

tl;dr: handlebars treats {{foo a=(bar "a") b=(bar "b")}} as if it were {{foo a=(bar "b") b=(bar "b")}}

jenseng commented Feb 20, 2014

actually it's worse than that. you can only have one subexpression in the options hash ... even if you use different helpers, the last one is the only one that gets used (see here)

tl;dr: handlebars treats {{foo a=(bar "a") b=(lol "b")}} as if it were {{foo a=(lol "b") b=(lol "b")}}

@kpdecker kpdecker pushed a commit that closed this issue Mar 5, 2014
@jenseng jenseng properly handle multiple subexpressions in the same hash, fixes #748
push all hash params before popping any so as to avoid the last stackN var
stomping previous ones
@kpdecker kpdecker closed this in 8493822 Mar 5, 2014

any chance this can be fixed in 1.3.X ? this is a doozy if you're relying on this pattern.


@dwabyick There are a number of changes that are interleaved so I don't believe we are going to be able to backport anything.

I suspect that we are gong to desupport the HTMLbars merge for 2.x as there hasn't been much traction on that and it's blocking the otherwise complete 2.x releases, including vital fixes such as the subexpression lookup issues. /cc @ebryn

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment