HTML/Less/Tree/Call.php
authoredward <edward@roojs.com>
Fri, 24 Nov 2017 12:40:59 +0000 (20:40 +0800)
committeredward <edward@roojs.com>
Fri, 24 Nov 2017 12:40:59 +0000 (20:40 +0800)
HTML/Less/Tree/Call.php

index 9203b0f..7d9f9ed 100644 (file)
@@ -72,6 +72,7 @@ class HTML_Less_Tree_Call extends HTML_Less_Tree {
         } else {
             
             require_once 'HTML/Less/Functions.php';
+            require_once 'HTML/Less/Exception/Compiler.php';
             
             if (method_exists('HTML_Less_Functions', $nameLC)) { // 1.
                 try {
@@ -79,14 +80,12 @@ class HTML_Less_Tree_Call extends HTML_Less_Tree {
                     $func = new HTML_Less_Functions($env, $this->currentFileInfo);
                     $result = call_user_func_array(array($func, $nameLC), $args);
                 } catch (Exception $e) {
-                    require_once 'HTML/Less/Exception/Compiler.php';
                     throw new HTML_Less_Exception_Compiler('error evaluating function `' . $this->name . '` ' . $e->getMessage() . ' index: ' . $this->index);
                 }
             } elseif (isset($env->functions[$nameLC]) && is_callable($env->functions[$nameLC])) {
                 try {
                     $result = call_user_func_array($env->functions[$nameLC], $args);
                 } catch (Exception $e) {
-                    require_once 'HTML/Less/Exception/Compiler.php';
                     throw new HTML_Less_Exception_Compiler('error evaluating function `' . $this->name . '` ' . $e->getMessage() . ' index: ' . $this->index);
                 }
             }