Local scope variables should not end up in 'template':variables(). #118

Closed
kaos opened this Issue Jan 18, 2014 · 0 comments

Comments

Projects
None yet
1 participant
Owner

kaos commented Jan 18, 2014

6> erlydtl:compile(<<"foo bar">>, foo).
{ok,foo}
7> foo:variables().
[]
8> erlydtl:compile(<<"foo {{ bar }}">>, bar).
{ok,bar}
9> bar:variables().                          
[bar]
10> erlydtl:compile(<<"{% for bar in foo %}{{ bar }}{% endfor %}">>, baz).
{ok,baz}
11> baz:variables().                                                      
[bar,foo]

7: ok
9: ok
11: should be: [foo]. because:

12> baz:render([{foo, [1, 2, 3]}]).
{ok,[[["1"],["2"],["3"]]]}
13> baz:render([{foo, [1, 2, 3]}, {bar, "ignored"}]).
{ok,[[["1"],["2"],["3"]]]}

kaos added this to the 1.0 milestone Feb 17, 2014

@kaos kaos added a commit that referenced this issue Feb 27, 2014

@kaos kaos Only list global variables (fixes #118) 274bd52

@kaos kaos modified the milestone: 0.9.1, 1.0 Feb 27, 2014

kaos self-assigned this Feb 27, 2014

kaos added the fixed label Feb 27, 2014

kaos closed this Feb 28, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment