-
Notifications
You must be signed in to change notification settings - Fork 638
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
Argument from caller macro is incorrectly passed through to callee macro? #478
Comments
Interesting! I'll look into this. I wonder if it's just arguments, or works for any variable of a matching name in the calling namespace... |
This was partly fixed by #667 -- macro frames are now totally separated from the calling frame, so there's no longer any way for a macro to reach out and see or touch its calling frame. So you can no longer see this behavior with macro arguments with a default of |
* master: (88 commits) Bump versions for dev. Update maintenance docs. Revert accidental changes to mocha.js. Bump version to 2.4.0. Update changelog. Merge pull request #694 from mariusbuescher/master Update changelog. Add support for boolean globals Add note about include and blocks; update wrapping of templating docs. Merge pull request #688 from pra85/patch-1 Add note about include and blocks; update wrapping of templating docs. Update api.md fixed bad character leading % in {% endraw %} Respect null/none as a value in its own right, distinct from undefined. Fixes #478. Use dot reporter for npm test. Don't bail on first failed test in 'npm test'. Add acknowledgement for #561 to changelog. Tighter scoping of vars in blocks, to match Jinja2. Fixes #561. Rename all test templates to use .j2 extension. Rename all test templates to use .j2 extension. ...
I'm still seeing this bug (or seeing it again?): http://jsfiddle.net/jgerigmeyer/tro6jhy9/1/ |
If a macro is called (using
{% call %}
) with an argument, and thecaller()
is itself a macro that accepts an argument with the same name with a default ofnone
, the argument from thecaller
macro is incorrectly passed through to thecallee
macro. That sounds ridiculously confusing, so here's the test case:When rendered via jinja2, this is the output:
However, when rendered via nunjucks, the output is:
This seems to only happen when the default for the
inner
arg isnone
; it doesn't occur when the default is''
orfalse
.The text was updated successfully, but these errors were encountered: