Skip to content

Commit 59c012c

Browse files
committed
2.5.1 release
1 parent 0671a12 commit 59c012c

File tree

5 files changed

+36
-30
lines changed

5 files changed

+36
-30
lines changed

bower.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "less",
3-
"version": "2.5.0",
3+
"version": "2.5.1",
44
"main": "dist/less.js",
55
"ignore": [
66
"**/.*",

dist/less.js

+27-19
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* Less - Leaner CSS v2.5.0
2+
* Less - Leaner CSS v2.5.1
33
* http://lesscss.org
44
*
55
* Copyright (c) 2009-2015, Alexis Sellier <[email protected]>
@@ -74,17 +74,17 @@ require("./add-default-options")(window, options);
7474

7575
var less = module.exports = require("./index")(window, options);
7676

77+
window.less = less;
78+
7779
if (options.onReady) {
7880
if (/!watch/.test(window.location.hash)) {
7981
less.watch();
8082
}
8183

82-
less.pageLoadFinished = less.registerStylesheets().then(
83-
function () {
84-
return less.refresh(less.env === 'development');
85-
}
86-
);
84+
less.registerStylesheetsImmediately();
85+
less.pageLoadFinished = less.refresh(less.env === 'development');
8786
}
87+
8888
},{"./add-default-options":1,"./index":7,"promise/polyfill.js":94}],3:[function(require,module,exports){
8989
var utils = require("./utils");
9090
module.exports = {
@@ -671,20 +671,28 @@ module.exports = function(window, options) {
671671
less.unwatch = function () {clearInterval(less.watchTimer); this.watchMode = false; return false; };
672672

673673
//
674-
// Get all <link> tags with the 'rel' attribute set to "stylesheet/less"
674+
// Synchronously get all <link> tags with the 'rel' attribute set to
675+
// "stylesheet/less".
675676
//
676-
less.registerStylesheets = function() {
677-
return new Promise(function(resolve, reject) {
678-
var links = document.getElementsByTagName('link');
679-
less.sheets = [];
677+
less.registerStylesheetsImmediately = function() {
678+
var links = document.getElementsByTagName('link');
679+
less.sheets = [];
680680

681-
for (var i = 0; i < links.length; i++) {
682-
if (links[i].rel === 'stylesheet/less' || (links[i].rel.match(/stylesheet/) &&
683-
(links[i].type.match(typePattern)))) {
684-
less.sheets.push(links[i]);
685-
}
681+
for (var i = 0; i < links.length; i++) {
682+
if (links[i].rel === 'stylesheet/less' || (links[i].rel.match(/stylesheet/) &&
683+
(links[i].type.match(typePattern)))) {
684+
less.sheets.push(links[i]);
686685
}
686+
}
687+
};
687688

689+
//
690+
// Asynchronously get all <link> tags with the 'rel' attribute set to
691+
// "stylesheet/less", returning a Promise.
692+
//
693+
less.registerStylesheets = function() {
694+
return new Promise(function(resolve, reject) {
695+
less.registerStylesheetsImmediately();
688696
resolve();
689697
});
690698
};
@@ -2372,7 +2380,7 @@ module.exports = function(environment, fileManagers) {
23722380
var SourceMapOutput, SourceMapBuilder, ParseTree, ImportManager, Environment;
23732381

23742382
var less = {
2375-
version: [2, 5, 0],
2383+
version: [2, 5, 1],
23762384
data: require('./data'),
23772385
tree: require('./tree'),
23782386
Environment: (Environment = require("./environment/environment")),
@@ -7002,7 +7010,7 @@ Definition.prototype.matchCondition = function (args, context) {
70027010
new contexts.Eval(context,
70037011
[this.evalParams(context, /* the parameter variables*/
70047012
new contexts.Eval(context, this.frames ? this.frames.concat(context.frames) : context.frames), args, [])]
7005-
.concat(this.frames) // the parent namespace/mixin frames
7013+
.concat(this.frames || []) // the parent namespace/mixin frames
70067014
.concat(context.frames)))) { // the current environment frames
70077015
return false;
70087016
}
@@ -7630,7 +7638,7 @@ Ruleset.prototype.variable = function (name) {
76307638
return this.variables()[name];
76317639
};
76327640
Ruleset.prototype.rulesets = function () {
7633-
if (!this.rules) { return null; }
7641+
if (!this.rules) { return []; }
76347642

76357643
var filtRules = [], rules = this.rules, cnt = rules.length,
76367644
i, rule;

dist/less.min.js

+6-8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/less/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module.exports = function(environment, fileManagers) {
22
var SourceMapOutput, SourceMapBuilder, ParseTree, ImportManager, Environment;
33

44
var less = {
5-
version: [2, 5, 0],
5+
version: [2, 5, 1],
66
data: require('./data'),
77
tree: require('./tree'),
88
Environment: (Environment = require("./environment/environment")),

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "less",
3-
"version": "2.5.0",
3+
"version": "2.5.1",
44
"description": "Leaner CSS",
55
"homepage": "http://lesscss.org",
66
"author": {

0 commit comments

Comments
 (0)