mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-13 02:46:29 +00:00
Improve performance of is defined in non strict mode
This commit is contained in:
@@ -20,7 +20,9 @@ class Twig_Node_Expression_GetAttr extends Twig_Node_Expression
|
||||
{
|
||||
$compiler->raw('$this->getAttribute(');
|
||||
|
||||
if ($this->hasAttribute('is_defined_test')) {
|
||||
if ($this->hasAttribute('is_defined_test')
|
||||
&& $compiler->getEnvironment()->isStrictVariables()
|
||||
) {
|
||||
$compiler->subcompile(new Twig_Node_Expression_Filter(
|
||||
$this->getNode('node'),
|
||||
new Twig_Node_Expression_Constant('default', $this->getLine()),
|
||||
|
||||
Reference in New Issue
Block a user