[Pkg-javascript-commits] [less.js] 35/58: optional imports

Jonas Smedegaard dr at jones.dk
Mon Oct 26 23:28:29 UTC 2015


This is an automated email from the git hooks/post-receive script.

js pushed a commit to annotated tag v2.3.0
in repository less.js.

commit 12969de390dc01cb3a91905fa771a78044f95644
Author: Bass Jobsen <bass at w3masters.nl>
Date:   Mon Jan 19 09:09:14 2015 +0100

    optional imports
    
    should fix https://github.com/less/less.js/issues/2145
---
 lib/less/import-manager.js | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/lib/less/import-manager.js b/lib/less/import-manager.js
index d70c160..386320a 100644
--- a/lib/less/import-manager.js
+++ b/lib/less/import-manager.js
@@ -40,12 +40,14 @@ module.exports = function(environment) {
             importManager.queue.splice(importManager.queue.indexOf(path), 1); // Remove the path from the queue
 
             var importedEqualsRoot = fullPath === importManager.rootFilename;
-
+            if (importOptions.optional && e) {
+			callback(null, {rules:[]}, false, null);		
+			}
+			else {
             importManager.files[fullPath] = root;
-
             if (e && !importManager.error) { importManager.error = e; }
-
             callback(e, root, importedEqualsRoot, fullPath);
+			}
         };
 
         var newFileInfo = {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/less.js.git



More information about the Pkg-javascript-commits mailing list