projects
/
konrad/twig.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
661e9c7
)
Improve performance of is defined in non strict mode
author
nikic
<nikita.ppv@googlemail.com>
Sat, 2 Jul 2011 09:20:54 +0000 (11:20 +0200)
committer
nikic
<nikita.ppv@googlemail.com>
Sat, 2 Jul 2011 09:21:49 +0000 (11:21 +0200)
lib/Twig/Node/Expression/GetAttr.php
patch
|
blob
|
history
diff --git
a/lib/Twig/Node/Expression/GetAttr.php
b/lib/Twig/Node/Expression/GetAttr.php
index
2208c9e
..
fcf50f6
100644
(file)
--- a/
lib/Twig/Node/Expression/GetAttr.php
+++ b/
lib/Twig/Node/Expression/GetAttr.php
@@
-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()),