Merge "Fix wrong return value in Preprocessor::getChildrenOfType"
authorTim Starling <tstarling@wikimedia.org>
Tue, 7 Aug 2012 00:37:53 +0000 (00:37 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 7 Aug 2012 00:37:53 +0000 (00:37 +0000)
includes/parser/Preprocessor_Hash.php
includes/parser/Preprocessor_HipHop.hphp

index 0e202fd..9296e3f 100644 (file)
@@ -1574,7 +1574,7 @@ class PPNode_Hash_Tree implements PPNode {
                $children = array();
                for ( $child = $this->firstChild; $child; $child = $child->nextSibling ) {
                        if ( isset( $child->name ) && $child->name === $name ) {
-                               $children[] = $name;
+                               $children[] = $child;
                        }
                }
                return $children;
index d7b0716..4ef5ca9 100644 (file)
@@ -1758,7 +1758,7 @@ class PPNode_HipHop_Tree implements PPNode {
                $children = array();
                for ( $child = $this->firstChild; $child; $child = $child->nextSibling ) {
                        if ( isset( $child->name ) && $child->name === $name ) {
-                               $children[] = $name;
+                               $children[] = $child;
                        }
                }
                return $children;