diff --git a/lib/Less/Visitor.php b/lib/Less/Visitor.php index 4de205f6..31522837 100644 --- a/lib/Less/Visitor.php +++ b/lib/Less/Visitor.php @@ -16,7 +16,10 @@ public function visitObj( $node ) { if ( !$node || !is_object( $node ) ) { return $node; } - $funcName = 'visit' . str_replace( [ 'Less_Tree_', '_' ], '', get_class( $node ) ); + + $prefixClassName = str_replace("Less"."_"."Visitor", "", __CLASS__); + $funcName = 'visit' . str_replace( [ $prefixClassName . 'Less_Tree_', '_' ], '', get_class( $node ) ); + if ( isset( $this->_visitFnCache[$funcName] ) ) { $visitDeeper = true; $newNode = $this->$funcName( $node, $visitDeeper );