Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subexpressions does not work with composed properties #800

Closed
beradrian opened this issue May 21, 2014 · 2 comments
Closed

Subexpressions does not work with composed properties #800

beradrian opened this issue May 21, 2014 · 2 comments

Comments

@beradrian
Copy link

HTML:

<script id="template" type="text/x-handlebars-template">
<ol>
    <li>{{dash 'abc' (concat a b)}}</li>
    <li>{{dash d (concat a b)}}</li>
    <li>{{dash c.c (concat a b)}}</li>
    <li>{{dash (concat a b) c.c}}</li>
    <li>{{dash (concat a e.e) c.c}}</li>
</ol>
</script>
<div id="rendered"></div>

JavaScript:

Handlebars.registerHelper('dash', function(a, b) {
    return a + "-" + b;
});

Handlebars.registerHelper('concat', function(a, b) {
    return a + b;
});

var template = Handlebars.compile($("#template").html());
$("#rendered").html(template({a: 'a', b:'b', c:{c:'c'}, d:'d', e: {e: 'e'}}));

jsfiddle: http://jsfiddle.net/beradrian/6T8ah/

The actual result is

1. abc-ab
2. d-ab
3. c-[object Object]
4. ab-c
5. ae-[object Object]

and it should be

1. abc-ab
2. d-ab
3. c-ab
4. ab-c
5. ae-c
kpdecker added a commit that referenced this issue May 27, 2014
This isn’t failing in master but this is a useful test to prevent regressions.
@kpdecker
Copy link
Collaborator

This is not failing under master. I don't know exactly what resolved this, but it may be related to #749.

@kpdecker
Copy link
Collaborator

Released in v2.0.0-beta.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants