FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Preserve the setting of a variable when calling eager macro function. by hs-lsong · Pull Request #1070 · HubSpot/jinjava · GitHub

Preserve the setting of a variable when calling eager macro function. - #1070

Merged
hs-lsong merged 2 commits into
masterfrom
set-variable-of-call
May 8, 2023
Merged

hs-lsong merged 2 commits into
masterfrom
set-variable-of-call

Conversation

hs-lsong commented May 8, 2023

Copy link
Copy Markdown
Collaborator

When running the EagerCallTag, we need to use the enterNonStackingScope instead of enterScope as the variables are in the same scope. They would have been removed if using a stacked scope. E.g.,

org.junit.ComparisonFailure: 
Expected :"{% set bar={} %}{% macro foo(bar, foobar, other) %} {% do bar.update({'a': 'b'}) %}  {{ foobar }}  {{ bar }} and {{ other }}{% endmacro %}{% call foo(bar, foobar, deferred) %} {% endcall %}{{ bar }}"
Actual   :"{% macro foo(bar, foobar, other) %} {% do bar.update({'a': 'b'} ) %}  {{ foobar }}  {{ bar }} and {{ other }}{% endmacro %}{% call foo(bar, null, deferred) %} {% endcall %}{{ bar }}"

hs-lsong merged commit ba9be23 into master May 8, 2023
hs-lsong deleted the set-variable-of-call branch May 8, 2023 19:38
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL