From 34ce163fbb5dfb43e26b73cd46af591ecb3530e8 Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Fri, 27 Sep 2013 14:23:09 +0200 Subject: [PATCH] lessphp: Update to upstream 6e8e724fc7 Summary of changes: - lessphp throws errors when referencing undeclared variables and mixins. - lessc::addParsedFile is now public. See . Change-Id: Idffe6946f4029659e677f9dfb62566096cc8d5b5 --- includes/libs/lessc.inc.php | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/includes/libs/lessc.inc.php b/includes/libs/lessc.inc.php index 6db21beb9c..7b1c27b1bb 100644 --- a/includes/libs/lessc.inc.php +++ b/includes/libs/lessc.inc.php @@ -1,7 +1,7 @@ findBlocks($block, $path, $orderedArgs, $keywordArgs); if ($mixins === null) { - // fwrite(STDERR,"failed to find block: ".implode(" > ", $path)."\n"); - break; // throw error here?? + $this->throwError("{$prop[1][0]} is undefined"); } foreach ($mixins as $mixin) { @@ -987,7 +984,7 @@ class lessc { if (isset($items[0])) { return $this->lib_e($items[0]); } - return self::$defaultValue; + $this->throwError("unrecognised input"); case "string": $arg[1] = ""; return $arg; @@ -1415,7 +1412,7 @@ class lessc { } $seen[$key] = true; - $out = $this->reduce($this->get($key, self::$defaultValue)); + $out = $this->reduce($this->get($key)); $seen[$key] = false; return $out; case "list": @@ -1774,7 +1771,7 @@ class lessc { // get the highest occurrence entry for a name - protected function get($name, $default=null) { + protected function get($name) { $current = $this->env; $isArguments = $name == $this->vPrefix . 'arguments'; @@ -1791,7 +1788,7 @@ class lessc { } } - return $default; + $this->throwError("variable $name is undefined"); } // inject array of unparsed strings into environment as variables @@ -2027,7 +2024,7 @@ class lessc { return $this->allParsedFiles; } - protected function addParsedFile($file) { + public function addParsedFile($file) { $this->allParsedFiles[realpath($file)] = filemtime($file); } -- 2.20.1