-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
String.length in lookup #589
Comments
Afaik Thanks for reporting! |
I believe this is actually a particular manifestation of a more general bug. See PR #618 |
phillipj
pushed a commit
that referenced
this issue
Aug 25, 2018
) * prevent value from being returned by Context.prototype.lookup if lookupHit is false * add test for renderability of Array.length via dot notation * Remove `typeof obj === 'object'` constraint in prop lookup Allows rendering properties of primitive types that are not objects, such as a string. * pop lookup needs to use hasOwnProperty for non-objs * re-add constraint in prop lookup, but make property lookups for primitives possible through dot notation * add test to address #589 specifically * enhance readability of primitiveHasOwnProperty and add comments to explain why it is used in one case but not the other
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Mustache.render('{{#list}}{{a.length}}{{/list}}', {list: [{a: 'a'}]}) === ""
When:
Mustache.render('{{a.length}}', {a: 'a'}) === "1"
The text was updated successfully, but these errors were encountered: