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

Only override context values from imported macro functions #889

Merged
merged 6 commits into from
Jul 15, 2022

Conversation

jasmith-hs
Copy link
Contributor

Fixes #888
Macro functions that are imported need to have their scope values put onto the current context when rendering them, however, non-imported macro functions do not need to override the current context values because that does not match the functionality in jinja.
This affects:

  • which macro function will be used inside a macro function
  • the value of variables inside a macro function
  • the caller() block which will be evaluated inside a macro function

I added tests for these three problems as well as a test class similar to EagerTest which makes it easy to add new tests.

@jasmith-hs jasmith-hs requested review from boulter and jmaroeder June 30, 2022 18:47
@jasmith-hs jasmith-hs merged commit eef6dcb into master Jul 15, 2022
@jasmith-hs jasmith-hs deleted the macro-scope-overrides branch July 15, 2022 17:44
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

Successfully merging this pull request may close these issues.

Fix Jinjava functionality for duplicate macro functions and call tags
1 participant