-
Notifications
You must be signed in to change notification settings - Fork 641
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
Cannot reference outer scopes from inside a {% call %}
block.
#679
Comments
This is related to #664; it has to do with how the frame stack for a |
This is a very annoying bug. You cannot take full advantage of call/caller feature without it. Are there any plans for fixing this bug? |
yeap, macros scopes are kinda buggy right now :( @atheros as far as I remember, making call with {% call outer(class='outer) %}{% endcall %} Ugly, but better than nothing. |
It doesn't work, the result is the same. |
You're probably on Nunjucks 3.0.0? As far as I remember, in 3.0.0 it is impossible to pass external variable into macros at all, due to bug described here #912 |
Yes, 3.0.0. And I cannot pass variables to call block, which pretty much makes call useless, except for very simple cases. Anyway downgrading to 2.5.2 fixes the issue. Thanks for the hint @ArmorDarks Interestingly, set block in macros doesn't work there (bug #914), so it's an older issue. |
I note that this bug still exists in v3.2.0. |
Originally reported by @jgerigmeyer at #481 (comment) -- all of the below copied from his report:
Consider the following test case:
Jinja2 outputs as expected:
But nunjucks outputs:
The text was updated successfully, but these errors were encountered: