Skip to content

Commit

Permalink
Fix the main browser tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeapage committed Oct 4, 2014
1 parent 7a6b1e2 commit 70bf802
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions lib/less-browser/browser-import.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function getXMLHttpRequest() {
return null;
}
}
};
}

var BrowserImport = function() {
};
Expand Down Expand Up @@ -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});
}
Expand All @@ -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();
};
2 changes: 1 addition & 1 deletion lib/less-browser/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
2 changes: 1 addition & 1 deletion lib/less/environment/environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit 70bf802

Please sign in to comment.