Skip to content

Fix expression resolver in import tag.#290

Merged
mattcoley merged 1 commit into
masterfrom
fix-import-tag
Feb 28, 2019
Merged

Fix expression resolver in import tag.#290
mattcoley merged 1 commit into
masterfrom
fix-import-tag

Conversation

@mattcoley

@mattcoley mattcoley commented Feb 28, 2019

Copy link
Copy Markdown
Collaborator

When doing {% import x as y %} we create a new child interpreter and use that to render the imported template and then copy over errors/macros. The issue is that the expression resolver uses the static JinjavaIntepreter.currentIntepreter() to resolve expressions, meaning that we are using the parent interpreter to resolve expressions in the child interpreter's render.

@mattcoley mattcoley requested a review from boulter February 28, 2019 17:05
@codecov-io

Copy link
Copy Markdown

Codecov Report

Merging #290 into master will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff             @@
##             master    #290      +/-   ##
===========================================
+ Coverage     72.28%   72.3%   +0.01%     
  Complexity     1497    1497              
===========================================
  Files           234     234              
  Lines          4648    4651       +3     
  Branches        739     739              
===========================================
+ Hits           3360    3363       +3     
  Misses         1033    1033              
  Partials        255     255
Impacted Files Coverage Δ Complexity Δ
...in/java/com/hubspot/jinjava/lib/tag/ImportTag.java 73.68% <100%> (+2.25%) 7 <0> (ø) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 815fdfd...0c17b13. Read the comment docs.

@mattcoley mattcoley merged commit eeb7261 into master Feb 28, 2019
@mattcoley mattcoley deleted the fix-import-tag branch February 28, 2019 17:27
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.

3 participants