Skip to content

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

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

Preserve the setting of a variable when calling eager macro function.#1070
hs-lsong merged 2 commits intomasterfrom
set-variable-of-call

Conversation

@hs-lsong
Copy link
Copy Markdown
Collaborator

@hs-lsong hs-lsong commented May 8, 2023

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 hs-lsong merged commit ba9be23 into master May 8, 2023
@hs-lsong hs-lsong deleted the set-variable-of-call branch May 8, 2023 19:38
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