Open
Description
The changes from #629 seem to throw unnecessary errors.
Following template should always run even if lie
isn't defined and strict_variables
is enabled - just the output should change:
The {{ baked_good }} is a{% if lie is defined and lie %} lie {% else %} reality {% endif %}!
However, with strict_variables
enabled it fails with TwigException: Variable "lie" does not exist.
Running Example: https://jsfiddle.net/jsz9uy3h/6/
If you use https://cdn.jsdelivr.net/npm/[email protected]/twig.min.js in above fiddle it works.
For the moment I can only think of introducing context awareness into the parse
function of Twig.expression.type.variable
. However this seems like a good way to clutter things :|