add tests and fix log to console feature

This commit is contained in:
Luke Page
2013-08-21 20:35:32 +01:00
parent 6c5072ebbc
commit 03a7183637
6 changed files with 55 additions and 10 deletions

View File

@@ -523,12 +523,11 @@ function removeErrorConsole(path) {
}
function errorConsole(e, rootHref) {
var template = '{line}\n{content}';
var template = '{line} {content}';
var filename = e.filename || rootHref;
var filenameNoPath = filename.match(/([^\/]+(\?.*)?)$/)[1];
content = (e.type || "Syntax") + "Error: " + (e.message || 'There is an error in your .less file') +
"'" + filename + "'";
var errors = [];
var content = (e.type || "Syntax") + "Error: " + (e.message || 'There is an error in your .less file') +
" in " + filename + " ";
var errorline = function (e, i, classname) {
if (e.extract[i] !== undefined) {
@@ -547,7 +546,7 @@ function errorConsole(e, rootHref) {
} else if (e.stack) {
content += e.stack;
}
log(content);
console.log(content);
}
function errorHTML(e, rootHref) {