[Pkg-javascript-commits] [less.js] 143/285: Fix the main browser tests

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


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

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

commit 70bf802b2c91888617af4b4570e8833dc8a4bf25
Author: Luke Page <luke.a.page at gmail.com>
Date:   Sat Oct 4 18:04:50 2014 +0100

    Fix the main browser tests
---
 lib/less-browser/browser-import.js  | 7 +++----
 lib/less-browser/index.js           | 2 +-
 lib/less/environment/environment.js | 2 +-
 3 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/lib/less-browser/browser-import.js b/lib/less-browser/browser-import.js
index 5a5ec3f..d06169b 100644
--- a/lib/less-browser/browser-import.js
+++ b/lib/less-browser/browser-import.js
@@ -22,7 +22,7 @@ function getXMLHttpRequest() {
             return null;
         }
     }
-};
+}
 
 var BrowserImport = function() {
 };
@@ -113,7 +113,7 @@ BrowserImport.prototype.loadFile = function loadFile(filename, currentDirectory,
         if (options.useFileCache && fileCache[href]) {
             try {
                 var lessText = fileCache[href];
-                fullfill({ content: lessText, filename: href, webInfo: { lastModified: new Date() }});
+                fullfill({ contents: lessText, filename: href, webInfo: { lastModified: new Date() }});
             } catch (e) {
                 reject({filename: href, message: "Error loading file " + href + " error was " + e.message});
             }
@@ -125,13 +125,12 @@ BrowserImport.prototype.loadFile = function loadFile(filename, currentDirectory,
             fileCache[href] = data;
 
             // Use remote copy (re-parse)
-            fullfill({ content: data, filename: href, webInfo: { lastModified: lastModified }});
+            fullfill({ contents: data, filename: href, webInfo: { lastModified: lastModified }});
         }, function doXHRError(status, url) {
             reject({ type: 'File', message: "'" + url + "' wasn't found (" + status + ")", filename: href });
         });
     }.bind(this));
 };
 
-
 return new BrowserImport();
 };
diff --git a/lib/less-browser/index.js b/lib/less-browser/index.js
index 8736884..375f94f 100644
--- a/lib/less-browser/index.js
+++ b/lib/less-browser/index.js
@@ -390,7 +390,7 @@ function loadStyleSheet(sheet, callback, reload, remaining, modifyVars) {
            webInfo = loadedFile.webInfo;
 
         var newFileInfo = {
-            currentDirectory: less.environment.getPath(path),
+            currentDirectory: browserImport.getPath(path),
             filename: path,
             rootFilename: path,
             relativeUrls: instanceOptions.relativeUrls};
diff --git a/lib/less/environment/environment.js b/lib/less/environment/environment.js
index 454bcaa..4508cf6 100644
--- a/lib/less/environment/environment.js
+++ b/lib/less/environment/environment.js
@@ -18,7 +18,7 @@ var environment = function(externalEnvironment, fileManagers) {
 environment.prototype.getFileManager = function (filename, currentDirectory, options, environment, isSync) {
     for(var i = this.fileManagers.length - 1; i >= 0 ; i--) {
         var fileManager = this.fileManagers[i];
-        if (fileManager[isSync ? "supports" : "supportsSync"](filename, currentDirectory, options, environment)) {
+        if (fileManager[isSync ? "supportsSync" : "supports"](filename, currentDirectory, options, environment)) {
             return fileManager;
         }
     }

-- 
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