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

can.Observe.prototype.each overrides {{#each}} Mustache helper. #258

Merged
merged 2 commits into from Mar 25, 2013

Conversation

Projects
None yet
3 participants
@daffl
Contributor

daffl commented Mar 25, 2013

In Mustache.get (can/view/mustache/mustache.js line 822 in current HEAD) prototype functions and data members of the context object override Mustache helpers. This causes the "each" helper to be unavailable when using a can.Observe, since its prototype includes "each", and an exception is thrown due to the two functions having different type signatures.

@ghost ghost assigned daffl Feb 25, 2013

@daffl

This comment has been minimized.

Show comment
Hide comment
@daffl

daffl Mar 13, 2013

Contributor

I'm assuming that helper should always have priority right?

Contributor

daffl commented Mar 13, 2013

I'm assuming that helper should always have priority right?

@justinbmeyer

This comment has been minimized.

Show comment
Hide comment
@justinbmeyer

justinbmeyer Mar 13, 2013

Contributor

I bet the specification has something to say about this.

If not, I'm not sure the helper would have higher priority. It might be more expensive to change a bunch of item's property names than to alias a helper.

Contributor

justinbmeyer commented Mar 13, 2013

I bet the specification has something to say about this.

If not, I'm not sure the helper would have higher priority. It might be more expensive to change a bunch of item's property names than to alias a helper.

@bmomberger-reciprocity

This comment has been minimized.

Show comment
Hide comment
@bmomberger-reciprocity

bmomberger-reciprocity Mar 13, 2013

Contributor

https://github.com/wycats/handlebars.js/blob/master/spec/qunit_spec.js#L1019
"helpers take precedence over same-named context properties"
"Scoped names [e.g. 'this.foo'] take precedence over helpers"

Contributor

bmomberger-reciprocity commented Mar 13, 2013

https://github.com/wycats/handlebars.js/blob/master/spec/qunit_spec.js#L1019
"helpers take precedence over same-named context properties"
"Scoped names [e.g. 'this.foo'] take precedence over helpers"

daffl added a commit that referenced this pull request Mar 25, 2013

Merge pull request #258 from bitovi/mustache-helper-priority-258
can.Observe.prototype.each overrides {{#each}} Mustache helper.

@daffl daffl merged commit d33de3f into master Mar 25, 2013

1 check passed

default The Travis build passed
Details

@daffl daffl deleted the mustache-helper-priority-258 branch Mar 25, 2013

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