Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v3.5.0-beta.6 #3255

Merged
merged 2 commits into from
Jul 3, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 15 additions & 10 deletions dist/less.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Less - Leaner CSS v3.5.0-beta.5
* Less - Leaner CSS v3.5.0-beta.6
* http://lesscss.org
*
* Copyright (c) 2009-2018, Alexis Sellier <self@cloudhead.net>
Expand Down Expand Up @@ -1498,7 +1498,8 @@ AbstractPluginLoader.prototype.evalPlugin = function(contents, context, imports,
try {
loader = new Function('module', 'require', 'registerPlugin', 'functions', 'tree', 'less', 'fileInfo', contents);
loader(localModule, this.require(filename), registerPlugin, registry, this.less.tree, this.less, fileInfo);
} catch (e) {
}
catch (e) {
return new LessError(e, imports, filename);
}

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

if (pluginObj) {
// For 2.x back-compatibility - setOptions() before install()
pluginObj.imports = imports;
pluginObj.filename = filename;
result = this.trySetOptions(pluginObj, filename, shortname, pluginOptions);
if (result) {
return result;

// For < 3.x (or unspecified minVersion) - setOptions() before install()
if (!pluginObj.minVersion || this.compareVersion('3.0.0', pluginObj.minVersion) < 0) {
result = this.trySetOptions(pluginObj, filename, shortname, pluginOptions);

if (result) {
return result;
}
}

// Run on first load
Expand Down Expand Up @@ -4721,7 +4726,7 @@ var Parser = function Parser(context, imports, fileInfo) {
.push({ variadic: true });
break;
}
arg = entities.variable() || entities.property() || entities.literal() || entities.keyword();
arg = entities.variable() || entities.property() || entities.literal() || entities.keyword() || this.call(true);
}

if (!arg) {
Expand Down Expand Up @@ -5232,7 +5237,7 @@ var Parser = function Parser(context, imports, fileInfo) {
important = this.important();
}

if (value && (hasDR || this.end())) {
if (value && (this.end() || hasDR)) {
parserInput.forget();
return new (tree.Declaration)(name, value, important, merge, index, fileInfo);
}
Expand Down Expand Up @@ -5413,7 +5418,7 @@ var Parser = function Parser(context, imports, fileInfo) {
var entities = this.entities, nodes = [], e, p;
parserInput.save();
do {
e = entities.keyword() || entities.variable();
e = entities.keyword() || entities.variable() || entities.mixinLookup();
if (e) {
nodes.push(e);
} else if (parserInput.$char('(')) {
Expand Down Expand Up @@ -5447,7 +5452,7 @@ var Parser = function Parser(context, imports, fileInfo) {
features.push(e);
if (!parserInput.$char(',')) { break; }
} else {
e = entities.variable();
e = entities.variable() || entities.mixinLookup();
if (e) {
features.push(e);
if (!parserInput.$char(',')) { break; }
Expand Down
14 changes: 7 additions & 7 deletions dist/less.min.js

Large diffs are not rendered by default.

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": "3.5.0-beta.5",
"version": "3.5.0-beta.6",
"description": "Leaner CSS",
"homepage": "http://lesscss.org",
"author": {
Expand Down
4 changes: 3 additions & 1 deletion test/less/plugin/plugin-set-options-v2.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ var optionsStack = [
'option3'
];

var optionsWereSet = false;
var options, error;

registerPlugin({
install: function(less, pluginManager, functions) {
if (!options) {
if (!optionsWereSet) {
error = 'setOptions() not called before install';
}
},
Expand All @@ -25,6 +26,7 @@ registerPlugin({
}
},
setOptions: function(opts) {
optionsWereSet = true;
options = opts;
},
minVersion: [2,0,0]
Expand Down