Skip to content

Commit

Permalink
fix trailing whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeapage committed Mar 2, 2014
1 parent 7dfc0cf commit aa3abeb
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 36 deletions.
4 changes: 2 additions & 2 deletions lib/less/environment/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ module.exports = {
},
loadFile: function(env, filename, currentDirectory, callback) {
var fullFilename,
data,
data,
isUrl = isUrlRe.test( filename );

if (isUrl || isUrlRe.test(currentDirectory)) {
Expand Down Expand Up @@ -206,4 +206,4 @@ module.exports = {
}
}
}
};
};
10 changes: 5 additions & 5 deletions lib/less/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -342,17 +342,17 @@ var functions = {
return new(tree.Dimension)(n.value * 100, '%');
},
color: function(c) {
if ((c instanceof tree.Quoted) &&
if ((c instanceof tree.Quoted) &&
(/^#([a-f0-9]{6}|[a-f0-9]{3})$/i.test(c.value))) {
return new(tree.Color)(c.value.slice(1));
}
if ((c instanceof tree.Color) || (c = tree.Color.fromKeyword(c.value))) {
c.keyword = undefined;
return c;
}
throw {
type: "Argument",
message: "argument must be a color keyword or 3/6 digit hex e.g. #FFF"
throw {
type: "Argument",
message: "argument must be a color keyword or 3/6 digit hex e.g. #FFF"
};
},
iscolor: function (n) {
Expand Down Expand Up @@ -729,5 +729,5 @@ tree.functionCall = function(env, currentFileInfo, environment) {
tree.functionCall.prototype = functions;

return functions;

};
6 changes: 3 additions & 3 deletions lib/less/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ less.render = function (input, options, callback) {
var css;
try {
css = root && root.toCSS && root.toCSS(options);
}
}
catch (err) { callback(err); return; }
callback(null, css);
});
Expand All @@ -27,7 +27,7 @@ less.render = function (input, options, callback) {
process.nextTick(function () {
parser.parse(input, function (e, root) {
if (e) { return ee.emit('error', e); }
try { ee.emit('success', root.toCSS(options)); }
try { ee.emit('success', root.toCSS(options)); }
catch (err) { ee.emit('error', err); }
});
});
Expand Down Expand Up @@ -83,7 +83,7 @@ less.formatError = function(ctx, options) {

return message;
};

less.writeError = function (ctx, options) {
options = options || {};
if (options.silent) { return; }
Expand Down
12 changes: 6 additions & 6 deletions lib/less/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,20 +81,20 @@ var Parser = function Parser(env) {
rootpath: currentFileInfo.rootpath,
rootFilename: currentFileInfo.rootFilename
};

less.environment.loadFile(env, path, currentFileInfo.currentDirectory, function loadFileCallback(e, contents, resolvedFilename) {
if (e) {
fileParsedFunc(e);
return;
}

// Pass on an updated rootpath if path of imported file is relative and file
// Pass on an updated rootpath if path of imported file is relative and file
// is in a (sub|sup) directory
//
// Examples:
//
// Examples:
// - If path of imported file is 'module/nav/nav.less' and rootpath is 'less/',
// then rootpath should become 'less/module/nav/'
// - If path of imported file is '../mixins.less' and rootpath is 'less/',
// - If path of imported file is '../mixins.less' and rootpath is 'less/',
// then rootpath should become 'less/../'
newFileInfo.currentDirectory = less.environment.getPath(env, resolvedFilename);
if(newFileInfo.relativeUrls) {
Expand All @@ -121,7 +121,7 @@ var Parser = function Parser(env) {
new(less.Parser)(newEnv).parse(contents, function (e, root) {
fileParsedFunc(e, root, resolvedFilename);
});
}
}
});
}
};
Expand Down
6 changes: 3 additions & 3 deletions lib/less/tree.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = function (less) {

var tree = {};

tree.debugInfo = function(env, ctx, lineSeperator) {
var result="";
if (env.dumpLineNumbers && !env.compress) {
Expand Down Expand Up @@ -131,8 +131,8 @@ tree.Media = require('./tree/media')(tree);
tree.UnicodeDescriptor = require('./tree/unicode-descriptor')(tree);
tree.Negative = require('./tree/negative')(tree);
tree.Extend = require('./tree/extend')(tree);
tree.RulesetCall = require('./tree/ruleset-call')(tree);
tree.RulesetCall = require('./tree/ruleset-call')(tree);

return tree;

};
};
10 changes: 5 additions & 5 deletions lib/less/tree/color.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Color.prototype = {
},
toCSS: function (env, doNotCompress) {
var compress = env && env.compress && !doNotCompress, color, alpha;

// `keyword` is set if this color was originally
// converted from a named color string so we need
// to respect this and try to output named color too.
Expand All @@ -61,8 +61,8 @@ Color.prototype = {
return clamp(Math.round(c), 255);
}).concat(clamp(alpha, 1))
.join(',' + (compress ? '' : ' ')) + ")";
}
}

color = this.toRGB();

if (compress) {
Expand Down Expand Up @@ -169,9 +169,9 @@ Color.fromKeyword = function(keyword) {
c = new(Color)(data.colors[key].slice(1));
}
else if (key === "transparent") {
c = new(Color)([0, 0, 0], 0);
c = new(Color)([0, 0, 0], 0);
}

if (c) {
c.keyword = keyword;
return c;
Expand Down
24 changes: 12 additions & 12 deletions lib/less/tree/mixin-call.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Call.prototype = {
eval: function (env) {
var mixins, mixin, args, rules = [], match = false, i, m, f, isRecursive, isOneFound, rule,
candidates = [], candidate, conditionResult = [], defaultFunc = tree.defaultFunc,
defaultResult, defNone = 0, defTrue = 1, defFalse = 2, count;
defaultResult, defNone = 0, defTrue = 1, defFalse = 2, count;

args = this.arguments && this.arguments.map(function (a) {
return { name: a.name, value: a.value.eval(env) };
Expand All @@ -29,12 +29,12 @@ Call.prototype = {
for (i = 0; i < env.frames.length; i++) {
if ((mixins = env.frames[i].find(this.selector)).length > 0) {
isOneFound = true;

// To make `default()` function independent of definition order we have two "subpasses" here.
// At first we evaluate each guard *twice* (with `default() == true` and `default() == false`),
// and build candidate list with corresponding flags. Then, when we know all possible matches,
// we make a final decision.

for (m = 0; m < mixins.length; m++) {
mixin = mixins[m];
isRecursive = false;
Expand All @@ -47,11 +47,11 @@ Call.prototype = {
if (isRecursive) {
continue;
}
if (mixin.matchArgs(args, env)) {

if (mixin.matchArgs(args, env)) {
candidate = {mixin: mixin, group: defNone};
if (mixin.matchCondition) {

if (mixin.matchCondition) {
for (f = 0; f < 2; f++) {
defaultFunc.value(f);
conditionResult[f] = mixin.matchCondition(args, env);
Expand All @@ -63,16 +63,16 @@ Call.prototype = {
}

candidates.push(candidate);
}
}
}
else {
candidates.push(candidate);
}

match = true;
}
}

defaultFunc.reset();

count = [0, 0, 0];
Expand All @@ -91,7 +91,7 @@ Call.prototype = {
index: this.index, filename: this.currentFileInfo.filename };
}
}

for (m = 0; m < candidates.length; m++) {
candidate = candidates[m].group;
if ((candidate === defNone) || (candidate === defaultResult)) {
Expand All @@ -108,7 +108,7 @@ Call.prototype = {
}
}
}

if (match) {
if (!this.currentFileInfo || !this.currentFileInfo.reference) {
for (i = 0; i < rules.length; i++) {
Expand Down

1 comment on commit aa3abeb

@XhmikosR
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you could do the same for test/media.css? I didn't do it because I didn't have to fix the failing test.

Please sign in to comment.