[Pkg-javascript-commits] [less.js] 09/09: v2.1.1 release

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


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

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

commit b6e391033d08b658bdb3dff098da10ef2cd66fd9
Author: Luke Page <luke.a.page at gmail.com>
Date:   Thu Nov 27 06:15:14 2014 +0000

    v2.1.1 release
---
 CHANGELOG.md      |  9 +++++++++
 bower.json        |  2 +-
 dist/less.js      | 45 +++++++++++++++++++++++++--------------------
 dist/less.min.js  |  6 +++---
 lib/less/index.js |  2 +-
 package.json      |  2 +-
 6 files changed, 40 insertions(+), 26 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index d2f4183..22fb289 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -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
diff --git a/bower.json b/bower.json
index 9d077c9..bb7b11d 100644
--- a/bower.json
+++ b/bower.json
@@ -1,6 +1,6 @@
 {
   "name": "less",
-  "version": "2.1.0",
+  "version": "2.1.1",
   "main": "dist/less.js",
   "ignore": [
     "**/.*",
diff --git a/dist/less.js b/dist/less.js
index 6d79fb7..7eed064 100644
--- a/dist/less.js
+++ b/dist/less.js
@@ -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 at cloudhead.net>
@@ -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")),
@@ -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),
@@ -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 {
@@ -4511,12 +4512,13 @@ 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);
         }
     };
@@ -4524,7 +4526,7 @@ module.exports = function(environment, ParseTree, ImportManager) {
 };
 
 },{"./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;
@@ -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() {
@@ -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;
@@ -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('');
@@ -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;
diff --git a/dist/less.min.js b/dist/less.min.js
index 9361e65..727a640 100644
--- a/dist/less.min.js
+++ b/dist/less.min.js
@@ -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 at cloudhead.net>
@@ -11,7 +11,7 @@
  */
 
 !function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;"undefined"!=typeof window?b=window:"undefined"!=typeof global?b=global:"undefined"!=typeof self&&(b=self),b.less=a()}}(function(){return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.co [...]
-return d=d?d instanceof b?d.value:d.toCSS():"",new c(a.value,d)},"get-unit":function(a){return new f(a.unit)},extract:function(a,b){return b=b.value-1,Array.isArray(a.value)?a.value[b]:Array(a)[b]},length:function(a){var b=Array.isArray(a.value)?a.value.length:1;return new c(b)}})},{"../tree/anonymous":42,"../tree/color":46,"../tree/dimension":52,"../tree/keyword":61,"../tree/operation":67,"../tree/quoted":69,"../tree/url":76,"./function-registry":21}],28:[function(a,b){var c=a("./contex [...]
-},d.prototype.toCSS=function(a){var b=this.key.toCSS?this.key.toCSS(a):this.key;return this.op&&(b+=this.op,b+=this.value.toCSS?this.value.toCSS(a):this.value),"["+b+"]"},b.exports=d},{"./node":66}],45:[function(a,b){var c=a("./node"),d=a("../functions/function-caller"),e=function(a,b,c,d){this.name=a,this.args=b,this.index=c,this.currentFileInfo=d};e.prototype=new c,e.prototype.type="Call",e.prototype.accept=function(a){this.args&&(this.args=a.visitArray(this.args))},e.prototype.eval=fu [...]
+return d=d?d instanceof b?d.value:d.toCSS():"",new c(a.value,d)},"get-unit":function(a){return new f(a.unit)},extract:function(a,b){return b=b.value-1,Array.isArray(a.value)?a.value[b]:Array(a)[b]},length:function(a){var b=Array.isArray(a.value)?a.value.length:1;return new c(b)}})},{"../tree/anonymous":42,"../tree/color":46,"../tree/dimension":52,"../tree/keyword":61,"../tree/operation":67,"../tree/quoted":69,"../tree/url":76,"./function-registry":21}],28:[function(a,b){var c=a("./contex [...]
+},d.prototype.genCSS=function(a,b){b.add(this.toCSS(a))},d.prototype.toCSS=function(a){var b=this.key.toCSS?this.key.toCSS(a):this.key;return this.op&&(b+=this.op,b+=this.value.toCSS?this.value.toCSS(a):this.value),"["+b+"]"},b.exports=d},{"./node":66}],45:[function(a,b){var c=a("./node"),d=a("../functions/function-caller"),e=function(a,b,c,d){this.name=a,this.args=b,this.index=c,this.currentFileInfo=d};e.prototype=new c,e.prototype.type="Call",e.prototype.accept=function(a){this.args&&( [...]
 }finally{d&&(a.strictMath=!1)}},g.prototype.makeImportant=function(){return new g(this.name,this.value,"!important",this.merge,this.index,this.currentFileInfo,this.inline)},b.exports=g},{"./keyword":61,"./node":66,"./value":77}],71:[function(a,b){var c=a("./node"),d=a("./variable"),e=function(a){this.variable=a};e.prototype=new c,e.prototype.type="RulesetCall",e.prototype.eval=function(a){var b=new d(this.variable).eval(a);return b.callEval(a)},b.exports=e},{"./node":66,"./variable":78}] [...]
 j.port1.onmessage=c,h=function(){j.port2.postMessage(0)}}else h=function(){setTimeout(c,0)};b.exports=d}).call(this,a("_process"))},{_process:87}],91:[function(){"function"!=typeof Promise.prototype.done&&(Promise.prototype.done=function(){var a=arguments.length?this.then.apply(this,arguments):this;a.then(null,function(a){setTimeout(function(){throw a},0)})})},{}],"promise/polyfill.js":[function(a){a("asap");"undefined"==typeof Promise&&(Promise=a("./lib/core.js"),a("./lib/es6-extensions [...]
\ No newline at end of file
diff --git a/lib/less/index.js b/lib/less/index.js
index e7aba3a..51fd54c 100644
--- a/lib/less/index.js
+++ b/lib/less/index.js
@@ -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")),
diff --git a/package.json b/package.json
index f84d152..4fe9725 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "less",
-  "version": "2.1.0",
+  "version": "2.1.1",
   "description": "Leaner CSS",
   "homepage": "http://lesscss.org",
   "author": {

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