Skip to content

Commit

Permalink
v2.1.1 release
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeapage committed Nov 27, 2014
1 parent 4dfdcdc commit b6e3910
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 26 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# 2.1.1

2014-11-27

- Improved keyword and anonymous usage with the replace function
- Added getCSSAppendage to sourcemap builder to avoid duplication in plugins
- Fix problem with plugins when used with the promises version of render
- If the render callback throws an exception it now propogates instead of calling the callback again with an error

# 2.1.0

2014-11-23
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "less",
"version": "2.1.0",
"version": "2.1.1",
"main": "dist/less.js",
"ignore": [
"**/.*",
Expand Down
45 changes: 25 additions & 20 deletions dist/less.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Less - Leaner CSS v2.1.0
* Less - Leaner CSS v2.1.1
* http://lesscss.org
*
* Copyright (c) 2009-2014, Alexis Sellier <self@cloudhead.net>
Expand Down Expand Up @@ -2222,7 +2222,7 @@ module.exports = function(environment, fileManagers) {
var SourceMapOutput, SourceMapBuilder, ParseTree, ImportManager, Environment;

var less = {
version: [2, 1, 0],
version: [2, 1, 1],
data: require('./data'),
tree: require('./tree'),
Environment: (Environment = require("./environment/environment")),
Expand All @@ -2233,7 +2233,7 @@ module.exports = function(environment, fileManagers) {
functions: require('./functions')(environment),
contexts: require("./contexts"),
SourceMapOutput: (SourceMapOutput = require('./source-map-output')(environment)),
SourceMapBuilder: (SourceMapBuilder = require('./source-map-builder')(SourceMapOutput)),
SourceMapBuilder: (SourceMapBuilder = require('./source-map-builder')(SourceMapOutput, environment)),
ParseTree: (ParseTree = require('./parse-tree')(SourceMapBuilder)),
ImportManager: (ImportManager = require('./import-manager')(environment)),
render: require("./render")(environment, ParseTree, ImportManager),
Expand Down Expand Up @@ -4472,8 +4472,9 @@ module.exports = function(environment, ParseTree, ImportManager) {
}

if (!callback) {
var self = this;
return new PromiseConstructor(function (resolve, reject) {
render(input, options, function(err, output) {
render.call(self, input, options, function(err, output) {
if (err) {
reject(err);
} else {
Expand Down Expand Up @@ -4511,20 +4512,21 @@ module.exports = function(environment, ParseTree, ImportManager) {
new Parser(context, imports, rootFileInfo)
.parse(input, function (e, root) {
if (e) { return callback(e); }
var result;
try {
var parseTree = new ParseTree(root, imports);
var result = parseTree.toCSS(options);
callback(null, result);
result = parseTree.toCSS(options);
}
catch (err) { callback( err); }
catch (err) { return callback( err); }
callback(null, result);
}, options);
}
};
return render;
};

},{"./contexts":10,"./parser/parser":35,"./plugin-manager":36,"promise":undefined}],38:[function(require,module,exports){
module.exports = function (SourceMapOutput) {
module.exports = function (SourceMapOutput, environment) {

var SourceMapBuilder = function (options) {
this.options = options;
Expand Down Expand Up @@ -4552,7 +4554,19 @@ module.exports = function (SourceMapOutput) {
if (this.options.sourceMapInputFilename) {
this.sourceMapInputFilename = sourceMapOutput.normalizeFilename(this.options.sourceMapInputFilename);
}
return css;
return css + this.getCSSAppendage();
};

SourceMapBuilder.prototype.getCSSAppendage = function() {
var sourceMapURL = this.sourceMapURL;
if (this.options.sourceMapFileInline) {
sourceMapURL = "data:application/json;base64," + environment.encodeBase64(this.sourceMap);
}

if (sourceMapURL) {
return "/*# sourceMappingURL=" + sourceMapURL + " */";
}
return "";
};

SourceMapBuilder.prototype.getExternalSourceMap = function() {
Expand Down Expand Up @@ -4604,7 +4618,6 @@ module.exports = function (environment) {
}
this._outputSourceFiles = options.outputSourceFiles;
this._sourceMapGeneratorConstructor = environment.getSourceMapGenerator();
this._sourceMapFileInline = options.sourceMapFileInline;

this._lineNumber = 0;
this._column = 0;
Expand Down Expand Up @@ -4711,15 +4724,7 @@ module.exports = function (environment) {
}
this.sourceMapURL = sourceMapURL;

if (!this._sourceMapFileInline) {
this.sourceMap = sourceMapContent;
} else {
sourceMapURL = "data:application/json;base64," + environment.encodeBase64(sourceMapContent);
}

if (sourceMapURL) {
this._css.push("/*# sourceMappingURL=" + sourceMapURL + " */");
}
this.sourceMap = sourceMapContent;
}

return this._css.join('');
Expand Down Expand Up @@ -6713,7 +6718,7 @@ var Node = require("./node"),
Variable = require("./variable");

var Quoted = function (str, content, escaped, index, currentFileInfo) {
this.escaped = escaped;
this.escaped = (escaped == null) ? true : escaped;
this.value = content || '';
this.quote = str.charAt(0);
this.index = index;
Expand Down
6 changes: 3 additions & 3 deletions dist/less.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/less/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module.exports = function(environment, fileManagers) {
var SourceMapOutput, SourceMapBuilder, ParseTree, ImportManager, Environment;

var less = {
version: [2, 1, 0],
version: [2, 1, 1],
data: require('./data'),
tree: require('./tree'),
Environment: (Environment = require("./environment/environment")),
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "less",
"version": "2.1.0",
"version": "2.1.1",
"description": "Leaner CSS",
"homepage": "http://lesscss.org",
"author": {
Expand Down

0 comments on commit b6e3910

Please sign in to comment.