Skip to content

Commit d821a37

Browse files
authored
v3.5.0-beta.6 (#3255)
* v3.5.0-beta.6 * Fix setOptions test
1 parent d542512 commit d821a37

File tree

4 files changed

+26
-19
lines changed

4 files changed

+26
-19
lines changed

dist/less.js

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* Less - Leaner CSS v3.5.0-beta.5
2+
* Less - Leaner CSS v3.5.0-beta.6
33
* http://lesscss.org
44
*
55
* Copyright (c) 2009-2018, Alexis Sellier <[email protected]>
@@ -1498,7 +1498,8 @@ AbstractPluginLoader.prototype.evalPlugin = function(contents, context, imports,
14981498
try {
14991499
loader = new Function('module', 'require', 'registerPlugin', 'functions', 'tree', 'less', 'fileInfo', contents);
15001500
loader(localModule, this.require(filename), registerPlugin, registry, this.less.tree, this.less, fileInfo);
1501-
} catch (e) {
1501+
}
1502+
catch (e) {
15021503
return new LessError(e, imports, filename);
15031504
}
15041505

@@ -1512,12 +1513,16 @@ AbstractPluginLoader.prototype.evalPlugin = function(contents, context, imports,
15121513
}
15131514

15141515
if (pluginObj) {
1515-
// For 2.x back-compatibility - setOptions() before install()
15161516
pluginObj.imports = imports;
15171517
pluginObj.filename = filename;
1518-
result = this.trySetOptions(pluginObj, filename, shortname, pluginOptions);
1519-
if (result) {
1520-
return result;
1518+
1519+
// For < 3.x (or unspecified minVersion) - setOptions() before install()
1520+
if (!pluginObj.minVersion || this.compareVersion('3.0.0', pluginObj.minVersion) < 0) {
1521+
result = this.trySetOptions(pluginObj, filename, shortname, pluginOptions);
1522+
1523+
if (result) {
1524+
return result;
1525+
}
15211526
}
15221527

15231528
// Run on first load
@@ -4721,7 +4726,7 @@ var Parser = function Parser(context, imports, fileInfo) {
47214726
.push({ variadic: true });
47224727
break;
47234728
}
4724-
arg = entities.variable() || entities.property() || entities.literal() || entities.keyword();
4729+
arg = entities.variable() || entities.property() || entities.literal() || entities.keyword() || this.call(true);
47254730
}
47264731

47274732
if (!arg) {
@@ -5232,7 +5237,7 @@ var Parser = function Parser(context, imports, fileInfo) {
52325237
important = this.important();
52335238
}
52345239

5235-
if (value && (hasDR || this.end())) {
5240+
if (value && (this.end() || hasDR)) {
52365241
parserInput.forget();
52375242
return new (tree.Declaration)(name, value, important, merge, index, fileInfo);
52385243
}
@@ -5413,7 +5418,7 @@ var Parser = function Parser(context, imports, fileInfo) {
54135418
var entities = this.entities, nodes = [], e, p;
54145419
parserInput.save();
54155420
do {
5416-
e = entities.keyword() || entities.variable();
5421+
e = entities.keyword() || entities.variable() || entities.mixinLookup();
54175422
if (e) {
54185423
nodes.push(e);
54195424
} else if (parserInput.$char('(')) {
@@ -5447,7 +5452,7 @@ var Parser = function Parser(context, imports, fileInfo) {
54475452
features.push(e);
54485453
if (!parserInput.$char(',')) { break; }
54495454
} else {
5450-
e = entities.variable();
5455+
e = entities.variable() || entities.mixinLookup();
54515456
if (e) {
54525457
features.push(e);
54535458
if (!parserInput.$char(',')) { break; }

dist/less.min.js

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "less",
3-
"version": "3.5.0-beta.5",
3+
"version": "3.5.0-beta.6",
44
"description": "Leaner CSS",
55
"homepage": "http://lesscss.org",
66
"author": {

test/less/plugin/plugin-set-options-v2.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@ var optionsStack = [
66
'option3'
77
];
88

9+
var optionsWereSet = false;
910
var options, error;
1011

1112
registerPlugin({
1213
install: function(less, pluginManager, functions) {
13-
if (!options) {
14+
if (!optionsWereSet) {
1415
error = 'setOptions() not called before install';
1516
}
1617
},
@@ -25,6 +26,7 @@ registerPlugin({
2526
}
2627
},
2728
setOptions: function(opts) {
29+
optionsWereSet = true;
2830
options = opts;
2931
},
3032
minVersion: [2,0,0]

0 commit comments

Comments
 (0)