Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / vendor / twig / twig / lib / Twig / Node / Expression / Name.php
index 9d5a21f87d768bab9d151e85aadeb64bd30b222f..7d3d6220e2f8b0bd1aaf5d56b7437cb845292ea4 100644 (file)
@@ -32,7 +32,12 @@ class Twig_Node_Expression_Name extends Twig_Node_Expression
             if ($this->isSpecial()) {
                 $compiler->repr(true);
             } else {
-                $compiler->raw('array_key_exists(')->repr($name)->raw(', $context)');
+                $compiler
+                    ->raw('(isset($context[')
+                    ->string($name)
+                    ->raw(']) || array_key_exists(')
+                    ->string($name)
+                    ->raw(', $context))');
             }
         } elseif ($this->isSpecial()) {
             $compiler->raw($this->specialVars[$name]);