less 4.2.0 → 4.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Gruntfile.js +3 -13
- package/dist/less.js +355 -254
- package/dist/less.min.js +3 -3
- package/dist/less.min.js.map +1 -1
- package/lib/less/contexts.js +1 -1
- package/lib/less/contexts.js.map +1 -1
- package/lib/less/environment/abstract-file-manager.js +3 -3
- package/lib/less/environment/abstract-file-manager.js.map +1 -1
- package/lib/less/environment/abstract-plugin-loader.js +2 -2
- package/lib/less/environment/abstract-plugin-loader.js.map +1 -1
- package/lib/less/environment/environment.js +1 -1
- package/lib/less/environment/environment.js.map +1 -1
- package/lib/less/functions/color.js +1 -1
- package/lib/less/functions/color.js.map +1 -1
- package/lib/less/functions/data-uri.js +3 -3
- package/lib/less/functions/data-uri.js.map +1 -1
- package/lib/less/functions/function-caller.js +1 -1
- package/lib/less/functions/function-caller.js.map +1 -1
- package/lib/less/functions/index.js +4 -2
- package/lib/less/functions/index.js.map +1 -1
- package/lib/less/functions/math.js +1 -1
- package/lib/less/functions/math.js.map +1 -1
- package/lib/less/functions/number.js +6 -3
- package/lib/less/functions/number.js.map +1 -1
- package/lib/less/functions/style.js +28 -0
- package/lib/less/functions/style.js.map +1 -0
- package/lib/less/functions/svg.js +5 -5
- package/lib/less/functions/svg.js.map +1 -1
- package/lib/less/functions/types.js +1 -1
- package/lib/less/functions/types.js.map +1 -1
- package/lib/less/import-manager.js +2 -2
- package/lib/less/import-manager.js.map +1 -1
- package/lib/less/index.js +8 -8
- package/lib/less/index.js.map +1 -1
- package/lib/less/less-error.js +10 -10
- package/lib/less/less-error.js.map +1 -1
- package/lib/less/parse-tree.js +1 -1
- package/lib/less/parse-tree.js.map +1 -1
- package/lib/less/parser/chunker.js +1 -1
- package/lib/less/parser/chunker.js.map +1 -1
- package/lib/less/parser/parser-input.js +1 -1
- package/lib/less/parser/parser-input.js.map +1 -1
- package/lib/less/parser/parser.js +84 -25
- package/lib/less/parser/parser.js.map +1 -1
- package/lib/less/source-map-builder.js +2 -2
- package/lib/less/source-map-builder.js.map +1 -1
- package/lib/less/transform-tree.js +1 -1
- package/lib/less/transform-tree.js.map +1 -1
- package/lib/less/tree/assignment.js +1 -1
- package/lib/less/tree/assignment.js.map +1 -1
- package/lib/less/tree/atrule.js +4 -4
- package/lib/less/tree/atrule.js.map +1 -1
- package/lib/less/tree/attribute.js +1 -1
- package/lib/less/tree/attribute.js.map +1 -1
- package/lib/less/tree/call.js +2 -2
- package/lib/less/tree/call.js.map +1 -1
- package/lib/less/tree/color.js +6 -6
- package/lib/less/tree/color.js.map +1 -1
- package/lib/less/tree/comment.js +1 -1
- package/lib/less/tree/comment.js.map +1 -1
- package/lib/less/tree/debug-info.js +5 -5
- package/lib/less/tree/debug-info.js.map +1 -1
- package/lib/less/tree/declaration.js +1 -1
- package/lib/less/tree/declaration.js.map +1 -1
- package/lib/less/tree/dimension.js +2 -2
- package/lib/less/tree/dimension.js.map +1 -1
- package/lib/less/tree/expression.js +5 -1
- package/lib/less/tree/expression.js.map +1 -1
- package/lib/less/tree/javascript.js +1 -1
- package/lib/less/tree/javascript.js.map +1 -1
- package/lib/less/tree/js-eval-node.js +5 -5
- package/lib/less/tree/js-eval-node.js.map +1 -1
- package/lib/less/tree/mixin-call.js +6 -6
- package/lib/less/tree/mixin-call.js.map +1 -1
- package/lib/less/tree/mixin-definition.js +2 -2
- package/lib/less/tree/mixin-definition.js.map +1 -1
- package/lib/less/tree/namespace-value.js +5 -5
- package/lib/less/tree/namespace-value.js.map +1 -1
- package/lib/less/tree/nested-at-rule.js +4 -0
- package/lib/less/tree/nested-at-rule.js.map +1 -1
- package/lib/less/tree/property.js +2 -2
- package/lib/less/tree/property.js.map +1 -1
- package/lib/less/tree/query-in-parens.js +32 -1
- package/lib/less/tree/query-in-parens.js.map +1 -1
- package/lib/less/tree/quoted.js +2 -2
- package/lib/less/tree/quoted.js.map +1 -1
- package/lib/less/tree/ruleset.js +7 -7
- package/lib/less/tree/ruleset.js.map +1 -1
- package/lib/less/tree/unit.js +1 -1
- package/lib/less/tree/unit.js.map +1 -1
- package/lib/less/tree/url.js +2 -2
- package/lib/less/tree/url.js.map +1 -1
- package/lib/less/tree/variable-call.js +1 -1
- package/lib/less/tree/variable-call.js.map +1 -1
- package/lib/less/tree/variable.js +3 -3
- package/lib/less/tree/variable.js.map +1 -1
- package/lib/less/utils.js +2 -2
- package/lib/less/utils.js.map +1 -1
- package/lib/less/visitors/extend-visitor.js +4 -4
- package/lib/less/visitors/extend-visitor.js.map +1 -1
- package/lib/less/visitors/to-css-visitor.js +3 -3
- package/lib/less/visitors/to-css-visitor.js.map +1 -1
- package/lib/less/visitors/visitor.js +2 -2
- package/lib/less/visitors/visitor.js.map +1 -1
- package/lib/less-browser/add-default-options.js +1 -1
- package/lib/less-browser/add-default-options.js.map +1 -1
- package/lib/less-browser/bootstrap.js +3 -3
- package/lib/less-browser/bootstrap.js.map +1 -1
- package/lib/less-browser/browser.js +1 -1
- package/lib/less-browser/browser.js.map +1 -1
- package/lib/less-browser/cache.js +6 -6
- package/lib/less-browser/cache.js.map +1 -1
- package/lib/less-browser/error-reporting.js +9 -9
- package/lib/less-browser/error-reporting.js.map +1 -1
- package/lib/less-browser/file-manager.js +3 -3
- package/lib/less-browser/file-manager.js.map +1 -1
- package/lib/less-browser/index.js +11 -11
- package/lib/less-browser/index.js.map +1 -1
- package/lib/less-node/file-manager.js +1 -1
- package/lib/less-node/file-manager.js.map +1 -1
- package/lib/less-node/image-size.js +1 -1
- package/lib/less-node/image-size.js.map +1 -1
- package/lib/less-node/index.js +1 -1
- package/lib/less-node/index.js.map +1 -1
- package/lib/less-node/lessc-helper.js +1 -1
- package/lib/less-node/lessc-helper.js.map +1 -1
- package/lib/less-node/url-file-manager.js +4 -4
- package/lib/less-node/url-file-manager.js.map +1 -1
- package/package.json +140 -140
- package/test/browser/css/plugin/plugin.css +1 -1
- package/test/browser/css/relative-urls/urls.css +8 -8
- package/test/browser/css/rewrite-urls/urls.css +8 -8
- package/test/browser/css/urls.css +12 -12
- package/test/browser/generator/generate.js +3 -3
- package/test/browser/generator/runner.config.js +18 -16
- package/test/browser/generator/template.js +17 -7
- package/test/browser/generator/utils.js +14 -0
- package/test/browser/less/relative-urls/urls.less +1 -1
- package/test/browser/less/rewrite-urls/urls.less +1 -1
- package/test/browser/less/rootpath/urls.less +1 -1
- package/test/browser/less/rootpath-relative/urls.less +1 -1
- package/test/browser/less/rootpath-rewrite-urls/urls.less +1 -1
- package/test/browser/less/urls.less +2 -2
- package/test/mocha-playwright/runner.js +210 -0
- package/tsconfig.json +20 -19
- package/LICENSE +0 -177
package/dist/less.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Less - Leaner CSS v4.2.
|
|
2
|
+
* Less - Leaner CSS v4.2.2
|
|
3
3
|
* http://lesscss.org
|
|
4
4
|
*
|
|
5
|
-
* Copyright (c) 2009-
|
|
5
|
+
* Copyright (c) 2009-2025, Alexis Sellier <self@cloudhead.net>
|
|
6
6
|
* Licensed under the Apache-2.0 License.
|
|
7
7
|
*
|
|
8
8
|
* @license Apache-2.0
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
|
13
13
|
typeof define === 'function' && define.amd ? define(factory) :
|
|
14
14
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.less = factory());
|
|
15
|
-
}(this, (function () { 'use strict';
|
|
15
|
+
})(this, (function () { 'use strict';
|
|
16
16
|
|
|
17
17
|
// Export a new default each time
|
|
18
18
|
function defaultOptions () {
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
// Strip the query-string
|
|
104
104
|
var href = sheet.href || '';
|
|
105
105
|
// If there is no title set, use the filename, minus the extension
|
|
106
|
-
var id = "less:"
|
|
106
|
+
var id = "less:".concat(sheet.title || extractId(href));
|
|
107
107
|
// If this has already been inserted into the DOM, we may need to replace it
|
|
108
108
|
var oldStyleNode = document.getElementById(id);
|
|
109
109
|
var keepOldStyleNode = false;
|
|
@@ -247,7 +247,7 @@
|
|
|
247
247
|
this[propName] = environmentFunc.bind(externalEnvironment);
|
|
248
248
|
}
|
|
249
249
|
else if (i_1 < requiredFunctions.length) {
|
|
250
|
-
this.warn("missing required function in environment - "
|
|
250
|
+
this.warn("missing required function in environment - ".concat(propName));
|
|
251
251
|
}
|
|
252
252
|
}
|
|
253
253
|
}
|
|
@@ -725,20 +725,20 @@
|
|
|
725
725
|
color = this.toHSL();
|
|
726
726
|
args = [
|
|
727
727
|
this.fround(context, color.h),
|
|
728
|
-
this.fround(context, color.s * 100)
|
|
729
|
-
this.fround(context, color.l * 100)
|
|
728
|
+
"".concat(this.fround(context, color.s * 100), "%"),
|
|
729
|
+
"".concat(this.fround(context, color.l * 100), "%")
|
|
730
730
|
].concat(args);
|
|
731
731
|
}
|
|
732
732
|
if (colorFunction) {
|
|
733
733
|
// Values are capped between `0` and `255`, rounded and zero-padded.
|
|
734
|
-
return colorFunction
|
|
734
|
+
return "".concat(colorFunction, "(").concat(args.join(",".concat(compress ? '' : ' ')), ")");
|
|
735
735
|
}
|
|
736
736
|
color = this.toRGB();
|
|
737
737
|
if (compress) {
|
|
738
738
|
var splitcolor = color.split('');
|
|
739
739
|
// Convert color to short format
|
|
740
740
|
if (splitcolor[1] === splitcolor[2] && splitcolor[3] === splitcolor[4] && splitcolor[5] === splitcolor[6]) {
|
|
741
|
-
color = "#"
|
|
741
|
+
color = "#".concat(splitcolor[1]).concat(splitcolor[3]).concat(splitcolor[5]);
|
|
742
742
|
}
|
|
743
743
|
}
|
|
744
744
|
return color;
|
|
@@ -850,10 +850,10 @@
|
|
|
850
850
|
return Math.min(Math.max(v, 0), max);
|
|
851
851
|
}
|
|
852
852
|
function toHex(v) {
|
|
853
|
-
return "#"
|
|
853
|
+
return "#".concat(v.map(function (c) {
|
|
854
854
|
c = clamp$1(Math.round(c), 255);
|
|
855
855
|
return (c < 16 ? '0' : '') + c.toString(16);
|
|
856
|
-
}).join('');
|
|
856
|
+
}).join(''));
|
|
857
857
|
}
|
|
858
858
|
|
|
859
859
|
var Paren = function (node) {
|
|
@@ -962,6 +962,47 @@
|
|
|
962
962
|
ALL: 2
|
|
963
963
|
};
|
|
964
964
|
|
|
965
|
+
/******************************************************************************
|
|
966
|
+
Copyright (c) Microsoft Corporation.
|
|
967
|
+
|
|
968
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
969
|
+
purpose with or without fee is hereby granted.
|
|
970
|
+
|
|
971
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
972
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
973
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
974
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
975
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
976
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
977
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
978
|
+
***************************************************************************** */
|
|
979
|
+
|
|
980
|
+
var __assign = function() {
|
|
981
|
+
__assign = Object.assign || function __assign(t) {
|
|
982
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
983
|
+
s = arguments[i];
|
|
984
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
985
|
+
}
|
|
986
|
+
return t;
|
|
987
|
+
};
|
|
988
|
+
return __assign.apply(this, arguments);
|
|
989
|
+
};
|
|
990
|
+
|
|
991
|
+
function __spreadArray(to, from, pack) {
|
|
992
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
993
|
+
if (ar || !(i in from)) {
|
|
994
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
995
|
+
ar[i] = from[i];
|
|
996
|
+
}
|
|
997
|
+
}
|
|
998
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
999
|
+
}
|
|
1000
|
+
|
|
1001
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
1002
|
+
var e = new Error(message);
|
|
1003
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
1004
|
+
};
|
|
1005
|
+
|
|
965
1006
|
/**
|
|
966
1007
|
* Returns the object type of the given payload
|
|
967
1008
|
*
|
|
@@ -975,7 +1016,7 @@
|
|
|
975
1016
|
* Returns whether the payload is a plain JavaScript object (excluding special classes or objects with other prototypes)
|
|
976
1017
|
*
|
|
977
1018
|
* @param {*} payload
|
|
978
|
-
* @returns {payload is
|
|
1019
|
+
* @returns {payload is PlainObject}
|
|
979
1020
|
*/
|
|
980
1021
|
function isPlainObject(payload) {
|
|
981
1022
|
if (getType(payload) !== 'Object')
|
|
@@ -992,28 +1033,6 @@
|
|
|
992
1033
|
return getType(payload) === 'Array';
|
|
993
1034
|
}
|
|
994
1035
|
|
|
995
|
-
/*! *****************************************************************************
|
|
996
|
-
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
997
|
-
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
998
|
-
this file except in compliance with the License. You may obtain a copy of the
|
|
999
|
-
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
1000
|
-
|
|
1001
|
-
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
1002
|
-
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
|
1003
|
-
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
1004
|
-
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
1005
|
-
|
|
1006
|
-
See the Apache Version 2.0 License for specific language governing permissions
|
|
1007
|
-
and limitations under the License.
|
|
1008
|
-
***************************************************************************** */
|
|
1009
|
-
function __spreadArrays() {
|
|
1010
|
-
for (var s = 0, i = 0, il = arguments.length; i < il; i++)
|
|
1011
|
-
s += arguments[i].length;
|
|
1012
|
-
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
1013
|
-
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
1014
|
-
r[k] = a[j];
|
|
1015
|
-
return r;
|
|
1016
|
-
}
|
|
1017
1036
|
function assignProp(carry, key, newVal, originalObject, includeNonenumerable) {
|
|
1018
1037
|
var propType = {}.propertyIsEnumerable.call(originalObject, key)
|
|
1019
1038
|
? 'enumerable'
|
|
@@ -1035,21 +1054,21 @@
|
|
|
1035
1054
|
* @export
|
|
1036
1055
|
* @template T
|
|
1037
1056
|
* @param {T} target Target can be anything
|
|
1038
|
-
* @param {Options} [options={}] Options can be `props` or `nonenumerable`
|
|
1057
|
+
* @param {Options} [options = {}] Options can be `props` or `nonenumerable`
|
|
1039
1058
|
* @returns {T} the target with replaced values
|
|
1040
1059
|
* @export
|
|
1041
1060
|
*/
|
|
1042
1061
|
function copy(target, options) {
|
|
1043
|
-
if (options === void 0) {
|
|
1044
|
-
|
|
1062
|
+
if (options === void 0) { options = {}; }
|
|
1063
|
+
if (isArray(target)) {
|
|
1064
|
+
return target.map(function (item) { return copy(item, options); });
|
|
1045
1065
|
}
|
|
1046
|
-
if (
|
|
1047
|
-
return target.map(function (i) { return copy(i, options); });
|
|
1048
|
-
if (!isPlainObject(target))
|
|
1066
|
+
if (!isPlainObject(target)) {
|
|
1049
1067
|
return target;
|
|
1068
|
+
}
|
|
1050
1069
|
var props = Object.getOwnPropertyNames(target);
|
|
1051
1070
|
var symbols = Object.getOwnPropertySymbols(target);
|
|
1052
|
-
return
|
|
1071
|
+
return __spreadArray(__spreadArray([], props, true), symbols, true).reduce(function (carry, key) {
|
|
1053
1072
|
if (isArray(options.props) && !options.props.includes(key)) {
|
|
1054
1073
|
return carry;
|
|
1055
1074
|
}
|
|
@@ -1288,16 +1307,16 @@
|
|
|
1288
1307
|
if (options.stylize) {
|
|
1289
1308
|
var type = typeof options.stylize;
|
|
1290
1309
|
if (type !== 'function') {
|
|
1291
|
-
throw Error("options.stylize should be a function, got a "
|
|
1310
|
+
throw Error("options.stylize should be a function, got a ".concat(type, "!"));
|
|
1292
1311
|
}
|
|
1293
1312
|
stylize = options.stylize;
|
|
1294
1313
|
}
|
|
1295
1314
|
if (this.line !== null) {
|
|
1296
1315
|
if (typeof extract[0] === 'string') {
|
|
1297
|
-
error.push(stylize(this.line - 1
|
|
1316
|
+
error.push(stylize("".concat(this.line - 1, " ").concat(extract[0]), 'grey'));
|
|
1298
1317
|
}
|
|
1299
1318
|
if (typeof extract[1] === 'string') {
|
|
1300
|
-
var errorTxt = this.line
|
|
1319
|
+
var errorTxt = "".concat(this.line, " ");
|
|
1301
1320
|
if (extract[1]) {
|
|
1302
1321
|
errorTxt += extract[1].slice(0, this.column) +
|
|
1303
1322
|
stylize(stylize(stylize(extract[1].substr(this.column, 1), 'bold') +
|
|
@@ -1306,21 +1325,21 @@
|
|
|
1306
1325
|
error.push(errorTxt);
|
|
1307
1326
|
}
|
|
1308
1327
|
if (typeof extract[2] === 'string') {
|
|
1309
|
-
error.push(stylize(this.line + 1
|
|
1328
|
+
error.push(stylize("".concat(this.line + 1, " ").concat(extract[2]), 'grey'));
|
|
1310
1329
|
}
|
|
1311
|
-
error = error.join('\n') + stylize('', 'reset')
|
|
1330
|
+
error = "".concat(error.join('\n') + stylize('', 'reset'), "\n");
|
|
1312
1331
|
}
|
|
1313
|
-
message += stylize(this.type
|
|
1332
|
+
message += stylize("".concat(this.type, "Error: ").concat(this.message), 'red');
|
|
1314
1333
|
if (this.filename) {
|
|
1315
1334
|
message += stylize(' in ', 'red') + this.filename;
|
|
1316
1335
|
}
|
|
1317
1336
|
if (this.line) {
|
|
1318
|
-
message += stylize(" on line "
|
|
1337
|
+
message += stylize(" on line ".concat(this.line, ", column ").concat(this.column + 1, ":"), 'grey');
|
|
1319
1338
|
}
|
|
1320
|
-
message += "\n"
|
|
1339
|
+
message += "\n".concat(error);
|
|
1321
1340
|
if (this.callLine) {
|
|
1322
|
-
message += stylize('from ', 'red') + (this.filename || '')
|
|
1323
|
-
message += stylize(this.callLine, 'grey')
|
|
1341
|
+
message += "".concat(stylize('from ', 'red') + (this.filename || ''), "/n");
|
|
1342
|
+
message += "".concat(stylize(this.callLine, 'grey'), " ").concat(this.callExtract, "/n");
|
|
1324
1343
|
}
|
|
1325
1344
|
return message;
|
|
1326
1345
|
};
|
|
@@ -1380,9 +1399,9 @@
|
|
|
1380
1399
|
var fnName;
|
|
1381
1400
|
visitArgs.visitDeeper = true;
|
|
1382
1401
|
if (!func) {
|
|
1383
|
-
fnName = "visit"
|
|
1402
|
+
fnName = "visit".concat(node.type);
|
|
1384
1403
|
func = impl[fnName] || _noop;
|
|
1385
|
-
funcOut = impl[fnName
|
|
1404
|
+
funcOut = impl["".concat(fnName, "Out")] || _noop;
|
|
1386
1405
|
this._visitInCache[nodeTypeIndex] = func;
|
|
1387
1406
|
this._visitOutCache[nodeTypeIndex] = funcOut;
|
|
1388
1407
|
}
|
|
@@ -1578,7 +1597,7 @@
|
|
|
1578
1597
|
if (isPathLocalRelative(path) &&
|
|
1579
1598
|
isPathRelative(rootpath) &&
|
|
1580
1599
|
isPathLocalRelative(newPath) === false) {
|
|
1581
|
-
newPath = "./"
|
|
1600
|
+
newPath = "./".concat(newPath);
|
|
1582
1601
|
}
|
|
1583
1602
|
return newPath;
|
|
1584
1603
|
};
|
|
@@ -1985,9 +2004,9 @@
|
|
|
1985
2004
|
selector = extend.selector.toCSS({});
|
|
1986
2005
|
}
|
|
1987
2006
|
catch (_) { }
|
|
1988
|
-
if (!indices[extend.index
|
|
1989
|
-
indices[extend.index
|
|
1990
|
-
logger$1.warn("extend '"
|
|
2007
|
+
if (!indices["".concat(extend.index, " ").concat(selector)]) {
|
|
2008
|
+
indices["".concat(extend.index, " ").concat(selector)] = true;
|
|
2009
|
+
logger$1.warn("extend '".concat(selector, "' has no matches"));
|
|
1991
2010
|
}
|
|
1992
2011
|
});
|
|
1993
2012
|
};
|
|
@@ -2068,7 +2087,7 @@
|
|
|
2068
2087
|
selectorTwo = extendsToAdd[0].selector.toCSS();
|
|
2069
2088
|
}
|
|
2070
2089
|
catch (e) { }
|
|
2071
|
-
throw { message: "extend circular reference detected. One of the circular extends is currently:"
|
|
2090
|
+
throw { message: "extend circular reference detected. One of the circular extends is currently:".concat(selectorOne, ":extend(").concat(selectorTwo, ")") };
|
|
2072
2091
|
}
|
|
2073
2092
|
// now process the new extends on the existing rules so that we can handle a extending b extending c extending
|
|
2074
2093
|
// d extending e...
|
|
@@ -2509,7 +2528,7 @@
|
|
|
2509
2528
|
// be considered illegal css as it has to be on the first line
|
|
2510
2529
|
if (this.charset) {
|
|
2511
2530
|
if (atRuleNode.debugInfo) {
|
|
2512
|
-
var comment = new tree.Comment("/* "
|
|
2531
|
+
var comment = new tree.Comment("/* ".concat(atRuleNode.toCSS(this._context).replace(/\n/g, ''), " */\n"));
|
|
2513
2532
|
comment.debugInfo = atRuleNode.debugInfo;
|
|
2514
2533
|
return this._visitor.visit(comment);
|
|
2515
2534
|
}
|
|
@@ -2530,11 +2549,11 @@
|
|
|
2530
2549
|
index: ruleNode.getIndex(), filename: ruleNode.fileInfo() && ruleNode.fileInfo().filename };
|
|
2531
2550
|
}
|
|
2532
2551
|
if (ruleNode instanceof tree.Call) {
|
|
2533
|
-
throw { message: "Function '"
|
|
2552
|
+
throw { message: "Function '".concat(ruleNode.name, "' did not return a root node"),
|
|
2534
2553
|
index: ruleNode.getIndex(), filename: ruleNode.fileInfo() && ruleNode.fileInfo().filename };
|
|
2535
2554
|
}
|
|
2536
2555
|
if (ruleNode.type && !ruleNode.allowRoot) {
|
|
2537
|
-
throw { message: ruleNode.type
|
|
2556
|
+
throw { message: "".concat(ruleNode.type, " node returned by a function is not valid here"),
|
|
2538
2557
|
index: ruleNode.getIndex(), filename: ruleNode.fileInfo() && ruleNode.fileInfo().filename };
|
|
2539
2558
|
}
|
|
2540
2559
|
}
|
|
@@ -2767,7 +2786,7 @@
|
|
|
2767
2786
|
if (matched) {
|
|
2768
2787
|
continue;
|
|
2769
2788
|
}
|
|
2770
|
-
return fail("unmatched `"
|
|
2789
|
+
return fail("unmatched `".concat(String.fromCharCode(cc), "`"), currentChunkStartIndex);
|
|
2771
2790
|
case 47: // /, check for comment
|
|
2772
2791
|
if (parenLevel || (chunkerCurrentIndex == len - 1)) {
|
|
2773
2792
|
continue;
|
|
@@ -3219,6 +3238,34 @@
|
|
|
3219
3238
|
queryInParens: true
|
|
3220
3239
|
};
|
|
3221
3240
|
|
|
3241
|
+
var Anonymous = function (value, index, currentFileInfo, mapLines, rulesetLike, visibilityInfo) {
|
|
3242
|
+
this.value = value;
|
|
3243
|
+
this._index = index;
|
|
3244
|
+
this._fileInfo = currentFileInfo;
|
|
3245
|
+
this.mapLines = mapLines;
|
|
3246
|
+
this.rulesetLike = (typeof rulesetLike === 'undefined') ? false : rulesetLike;
|
|
3247
|
+
this.allowRoot = true;
|
|
3248
|
+
this.copyVisibilityInfo(visibilityInfo);
|
|
3249
|
+
};
|
|
3250
|
+
Anonymous.prototype = Object.assign(new Node(), {
|
|
3251
|
+
type: 'Anonymous',
|
|
3252
|
+
eval: function () {
|
|
3253
|
+
return new Anonymous(this.value, this._index, this._fileInfo, this.mapLines, this.rulesetLike, this.visibilityInfo());
|
|
3254
|
+
},
|
|
3255
|
+
compare: function (other) {
|
|
3256
|
+
return other.toCSS && this.toCSS() === other.toCSS() ? 0 : undefined;
|
|
3257
|
+
},
|
|
3258
|
+
isRulesetLike: function () {
|
|
3259
|
+
return this.rulesetLike;
|
|
3260
|
+
},
|
|
3261
|
+
genCSS: function (context, output) {
|
|
3262
|
+
this.nodeVisible = Boolean(this.value);
|
|
3263
|
+
if (this.nodeVisible) {
|
|
3264
|
+
output.add(this.value, this._fileInfo, this._index, this.mapLines);
|
|
3265
|
+
}
|
|
3266
|
+
}
|
|
3267
|
+
});
|
|
3268
|
+
|
|
3222
3269
|
//
|
|
3223
3270
|
// less.js - parser
|
|
3224
3271
|
//
|
|
@@ -3270,7 +3317,7 @@
|
|
|
3270
3317
|
return result;
|
|
3271
3318
|
}
|
|
3272
3319
|
error(msg || (typeof arg === 'string'
|
|
3273
|
-
? "expected '"
|
|
3320
|
+
? "expected '".concat(arg, "' got '").concat(parserInput.currentChar(), "'")
|
|
3274
3321
|
: 'unexpected token'));
|
|
3275
3322
|
}
|
|
3276
3323
|
// Specialization of expect()
|
|
@@ -3278,7 +3325,7 @@
|
|
|
3278
3325
|
if (parserInput.$char(arg)) {
|
|
3279
3326
|
return arg;
|
|
3280
3327
|
}
|
|
3281
|
-
error(msg || "expected '"
|
|
3328
|
+
error(msg || "expected '".concat(arg, "' got '").concat(parserInput.currentChar(), "'"));
|
|
3282
3329
|
}
|
|
3283
3330
|
function getDebugInfo(index) {
|
|
3284
3331
|
var filename = fileInfo.filename;
|
|
@@ -3355,8 +3402,8 @@
|
|
|
3355
3402
|
}
|
|
3356
3403
|
};
|
|
3357
3404
|
}
|
|
3358
|
-
globalVars = (additionalData && additionalData.globalVars) ? Parser.serializeVars(additionalData.globalVars)
|
|
3359
|
-
modifyVars = (additionalData && additionalData.modifyVars) ? "\n"
|
|
3405
|
+
globalVars = (additionalData && additionalData.globalVars) ? "".concat(Parser.serializeVars(additionalData.globalVars), "\n") : '';
|
|
3406
|
+
modifyVars = (additionalData && additionalData.modifyVars) ? "\n".concat(Parser.serializeVars(additionalData.modifyVars)) : '';
|
|
3360
3407
|
if (context.pluginManager) {
|
|
3361
3408
|
var preProcessors = context.pluginManager.getPreProcessors();
|
|
3362
3409
|
for (var i_1 = 0; i_1 < preProcessors.length; i_1++) {
|
|
@@ -3622,6 +3669,32 @@
|
|
|
3622
3669
|
parserInput.forget();
|
|
3623
3670
|
return new (tree.Call)(name, args, index + currentIndex, fileInfo);
|
|
3624
3671
|
},
|
|
3672
|
+
declarationCall: function () {
|
|
3673
|
+
var validCall;
|
|
3674
|
+
var args;
|
|
3675
|
+
var index = parserInput.i;
|
|
3676
|
+
parserInput.save();
|
|
3677
|
+
validCall = parserInput.$re(/^[\w]+\(/);
|
|
3678
|
+
if (!validCall) {
|
|
3679
|
+
parserInput.forget();
|
|
3680
|
+
return;
|
|
3681
|
+
}
|
|
3682
|
+
validCall = validCall.substring(0, validCall.length - 1);
|
|
3683
|
+
var rule = this.ruleProperty();
|
|
3684
|
+
var value;
|
|
3685
|
+
if (rule) {
|
|
3686
|
+
value = this.value();
|
|
3687
|
+
}
|
|
3688
|
+
if (rule && value) {
|
|
3689
|
+
args = [new (tree.Declaration)(rule, value, null, null, parserInput.i + currentIndex, fileInfo, true)];
|
|
3690
|
+
}
|
|
3691
|
+
if (!parserInput.$char(')')) {
|
|
3692
|
+
parserInput.restore('Could not parse call arguments or missing \')\'');
|
|
3693
|
+
return;
|
|
3694
|
+
}
|
|
3695
|
+
parserInput.forget();
|
|
3696
|
+
return new (tree.Call)(validCall, args, index + currentIndex, fileInfo);
|
|
3697
|
+
},
|
|
3625
3698
|
//
|
|
3626
3699
|
// Parsing rules for functions with non-standard args, e.g.:
|
|
3627
3700
|
//
|
|
@@ -3774,7 +3847,7 @@
|
|
|
3774
3847
|
var curly;
|
|
3775
3848
|
var index = parserInput.i;
|
|
3776
3849
|
if (parserInput.currentChar() === '@' && (curly = parserInput.$re(/^@\{([\w-]+)\}/))) {
|
|
3777
|
-
return new (tree.Variable)("@"
|
|
3850
|
+
return new (tree.Variable)("@".concat(curly[1]), index + currentIndex, fileInfo);
|
|
3778
3851
|
}
|
|
3779
3852
|
},
|
|
3780
3853
|
//
|
|
@@ -3794,7 +3867,7 @@
|
|
|
3794
3867
|
var curly;
|
|
3795
3868
|
var index = parserInput.i;
|
|
3796
3869
|
if (parserInput.currentChar() === '$' && (curly = parserInput.$re(/^\$\{([\w-]+)\}/))) {
|
|
3797
|
-
return new (tree.Property)("$"
|
|
3870
|
+
return new (tree.Property)("$".concat(curly[1]), index + currentIndex, fileInfo);
|
|
3798
3871
|
}
|
|
3799
3872
|
},
|
|
3800
3873
|
//
|
|
@@ -4325,10 +4398,10 @@
|
|
|
4325
4398
|
value = parserInput.$re(/^\d+/);
|
|
4326
4399
|
if (!value) {
|
|
4327
4400
|
value = expect(parsers.entities.variable, 'Could not parse alpha');
|
|
4328
|
-
value = "@{"
|
|
4401
|
+
value = "@{".concat(value.name.slice(1), "}");
|
|
4329
4402
|
}
|
|
4330
4403
|
expectChar(')');
|
|
4331
|
-
return new tree.Quoted('', "alpha(opacity="
|
|
4404
|
+
return new tree.Quoted('', "alpha(opacity=".concat(value, ")"));
|
|
4332
4405
|
},
|
|
4333
4406
|
//
|
|
4334
4407
|
// A Selector Element
|
|
@@ -4357,9 +4430,26 @@
|
|
|
4357
4430
|
if (!e) {
|
|
4358
4431
|
parserInput.save();
|
|
4359
4432
|
if (parserInput.$char('(')) {
|
|
4360
|
-
if ((v = this.selector(false))
|
|
4361
|
-
|
|
4362
|
-
parserInput
|
|
4433
|
+
if ((v = this.selector(false))) {
|
|
4434
|
+
var selectors = [];
|
|
4435
|
+
while (parserInput.$char(',')) {
|
|
4436
|
+
selectors.push(v);
|
|
4437
|
+
selectors.push(new Anonymous(','));
|
|
4438
|
+
v = this.selector(false);
|
|
4439
|
+
}
|
|
4440
|
+
selectors.push(v);
|
|
4441
|
+
if (parserInput.$char(')')) {
|
|
4442
|
+
if (selectors.length > 1) {
|
|
4443
|
+
e = new (tree.Paren)(new Selector(selectors));
|
|
4444
|
+
}
|
|
4445
|
+
else {
|
|
4446
|
+
e = new (tree.Paren)(v);
|
|
4447
|
+
}
|
|
4448
|
+
parserInput.forget();
|
|
4449
|
+
}
|
|
4450
|
+
else {
|
|
4451
|
+
parserInput.restore('Missing closing \')\'');
|
|
4452
|
+
}
|
|
4363
4453
|
}
|
|
4364
4454
|
else {
|
|
4365
4455
|
parserInput.restore('Missing closing \')\'');
|
|
@@ -4450,6 +4540,9 @@
|
|
|
4450
4540
|
error('Extend can only be used at the end of selector');
|
|
4451
4541
|
}
|
|
4452
4542
|
c = parserInput.currentChar();
|
|
4543
|
+
if (Array.isArray(e)) {
|
|
4544
|
+
e.forEach(function (ele) { return elements.push(ele); });
|
|
4545
|
+
}
|
|
4453
4546
|
if (elements) {
|
|
4454
4547
|
elements.push(e);
|
|
4455
4548
|
}
|
|
@@ -4624,7 +4717,12 @@
|
|
|
4624
4717
|
merge = !isVariable && name.length > 1 && name.pop().value;
|
|
4625
4718
|
// Custom property values get permissive parsing
|
|
4626
4719
|
if (name[0].value && name[0].value.slice(0, 2) === '--') {
|
|
4627
|
-
|
|
4720
|
+
if (parserInput.$char(';')) {
|
|
4721
|
+
value = new Anonymous('');
|
|
4722
|
+
}
|
|
4723
|
+
else {
|
|
4724
|
+
value = this.permissiveValue(/[;}]/);
|
|
4725
|
+
}
|
|
4628
4726
|
}
|
|
4629
4727
|
// Try to store values as anonymous
|
|
4630
4728
|
// If we need the value later we'll re-parse it in ruleset.parseValue
|
|
@@ -4706,6 +4804,10 @@
|
|
|
4706
4804
|
if (e) {
|
|
4707
4805
|
value.push(e);
|
|
4708
4806
|
}
|
|
4807
|
+
if (parserInput.peek(',')) {
|
|
4808
|
+
value.push(new (tree.Anonymous)(',', parserInput.i));
|
|
4809
|
+
parserInput.$char(',');
|
|
4810
|
+
}
|
|
4709
4811
|
} while (e);
|
|
4710
4812
|
done = testCurrentChar();
|
|
4711
4813
|
if (value.length > 0) {
|
|
@@ -4725,7 +4827,7 @@
|
|
|
4725
4827
|
value = parserInput.$parseUntil(tok);
|
|
4726
4828
|
if (value) {
|
|
4727
4829
|
if (typeof value === 'string') {
|
|
4728
|
-
error("Expected '"
|
|
4830
|
+
error("Expected '".concat(value, "'"), 'Parse');
|
|
4729
4831
|
}
|
|
4730
4832
|
if (value.length === 1 && value[0] === ' ') {
|
|
4731
4833
|
parserInput.forget();
|
|
@@ -4744,7 +4846,9 @@
|
|
|
4744
4846
|
}
|
|
4745
4847
|
// Treat like quoted values, but replace vars like unquoted expressions
|
|
4746
4848
|
var quote = new tree.Quoted('\'', item, true, index, fileInfo);
|
|
4747
|
-
|
|
4849
|
+
if (!item.startsWith('@{')) {
|
|
4850
|
+
quote.variableRegex = /@([\w-]+)/g;
|
|
4851
|
+
}
|
|
4748
4852
|
quote.propRegex = /\$([\w-]+)/g;
|
|
4749
4853
|
result.push(quote);
|
|
4750
4854
|
}
|
|
@@ -4833,7 +4937,7 @@
|
|
|
4833
4937
|
var rangeP;
|
|
4834
4938
|
parserInput.save();
|
|
4835
4939
|
do {
|
|
4836
|
-
e = entities.keyword() || entities.variable() || entities.mixinLookup();
|
|
4940
|
+
e = entities.declarationCall.bind(this)() || entities.keyword() || entities.variable() || entities.mixinLookup();
|
|
4837
4941
|
if (e) {
|
|
4838
4942
|
nodes.push(e);
|
|
4839
4943
|
}
|
|
@@ -5014,7 +5118,7 @@
|
|
|
5014
5118
|
}
|
|
5015
5119
|
nonVendorSpecificName = name;
|
|
5016
5120
|
if (name.charAt(1) == '-' && name.indexOf('-', 2) > 0) {
|
|
5017
|
-
nonVendorSpecificName = "@"
|
|
5121
|
+
nonVendorSpecificName = "@".concat(name.slice(name.indexOf('-', 2) + 1));
|
|
5018
5122
|
}
|
|
5019
5123
|
switch (nonVendorSpecificName) {
|
|
5020
5124
|
case '@charset':
|
|
@@ -5042,13 +5146,13 @@
|
|
|
5042
5146
|
if (hasIdentifier) {
|
|
5043
5147
|
value = this.entity();
|
|
5044
5148
|
if (!value) {
|
|
5045
|
-
error("expected "
|
|
5149
|
+
error("expected ".concat(name, " identifier"));
|
|
5046
5150
|
}
|
|
5047
5151
|
}
|
|
5048
5152
|
else if (hasExpression) {
|
|
5049
5153
|
value = this.expression();
|
|
5050
5154
|
if (!value) {
|
|
5051
|
-
error("expected "
|
|
5155
|
+
error("expected ".concat(name, " expression"));
|
|
5052
5156
|
}
|
|
5053
5157
|
}
|
|
5054
5158
|
else if (hasUnknown) {
|
|
@@ -5056,7 +5160,7 @@
|
|
|
5056
5160
|
hasBlock = (parserInput.currentChar() === '{');
|
|
5057
5161
|
if (!value) {
|
|
5058
5162
|
if (!hasBlock && parserInput.currentChar() !== ';') {
|
|
5059
|
-
error(name
|
|
5163
|
+
error("".concat(name, " rule is missing block or ending semi-colon"));
|
|
5060
5164
|
}
|
|
5061
5165
|
}
|
|
5062
5166
|
else if (!value.value) {
|
|
@@ -5294,7 +5398,7 @@
|
|
|
5294
5398
|
return;
|
|
5295
5399
|
}
|
|
5296
5400
|
if (!parserInput.$char(')')) {
|
|
5297
|
-
parserInput.restore("expected ')' got '"
|
|
5401
|
+
parserInput.restore("expected ')' got '".concat(parserInput.currentChar(), "'"));
|
|
5298
5402
|
return;
|
|
5299
5403
|
}
|
|
5300
5404
|
parserInput.forget();
|
|
@@ -5394,7 +5498,7 @@
|
|
|
5394
5498
|
var index = parserInput.i;
|
|
5395
5499
|
do {
|
|
5396
5500
|
e = this.comment();
|
|
5397
|
-
if (e) {
|
|
5501
|
+
if (e && !e.isLineComment) {
|
|
5398
5502
|
entities.push(e);
|
|
5399
5503
|
continue;
|
|
5400
5504
|
}
|
|
@@ -5462,8 +5566,8 @@
|
|
|
5462
5566
|
name[k] = (s.charAt(0) !== '@' && s.charAt(0) !== '$') ?
|
|
5463
5567
|
new (tree.Keyword)(s) :
|
|
5464
5568
|
(s.charAt(0) === '@' ?
|
|
5465
|
-
new (tree.Variable)("@"
|
|
5466
|
-
new (tree.Property)("$"
|
|
5569
|
+
new (tree.Variable)("@".concat(s.slice(2, -1)), index[k] + currentIndex, fileInfo) :
|
|
5570
|
+
new (tree.Property)("$".concat(s.slice(2, -1)), index[k] + currentIndex, fileInfo));
|
|
5467
5571
|
}
|
|
5468
5572
|
return name;
|
|
5469
5573
|
}
|
|
@@ -5477,7 +5581,7 @@
|
|
|
5477
5581
|
for (var name_1 in vars) {
|
|
5478
5582
|
if (Object.hasOwnProperty.call(vars, name_1)) {
|
|
5479
5583
|
var value = vars[name_1];
|
|
5480
|
-
s += ((name_1[0] === '@') ? '' : '@') + name_1
|
|
5584
|
+
s += "".concat(((name_1[0] === '@') ? '' : '@') + name_1, ": ").concat(value).concat((String(value).slice(-1) === ';') ? '' : ';');
|
|
5481
5585
|
}
|
|
5482
5586
|
}
|
|
5483
5587
|
return s;
|
|
@@ -5655,34 +5759,6 @@
|
|
|
5655
5759
|
Keyword.True = new Keyword('true');
|
|
5656
5760
|
Keyword.False = new Keyword('false');
|
|
5657
5761
|
|
|
5658
|
-
var Anonymous = function (value, index, currentFileInfo, mapLines, rulesetLike, visibilityInfo) {
|
|
5659
|
-
this.value = value;
|
|
5660
|
-
this._index = index;
|
|
5661
|
-
this._fileInfo = currentFileInfo;
|
|
5662
|
-
this.mapLines = mapLines;
|
|
5663
|
-
this.rulesetLike = (typeof rulesetLike === 'undefined') ? false : rulesetLike;
|
|
5664
|
-
this.allowRoot = true;
|
|
5665
|
-
this.copyVisibilityInfo(visibilityInfo);
|
|
5666
|
-
};
|
|
5667
|
-
Anonymous.prototype = Object.assign(new Node(), {
|
|
5668
|
-
type: 'Anonymous',
|
|
5669
|
-
eval: function () {
|
|
5670
|
-
return new Anonymous(this.value, this._index, this._fileInfo, this.mapLines, this.rulesetLike, this.visibilityInfo());
|
|
5671
|
-
},
|
|
5672
|
-
compare: function (other) {
|
|
5673
|
-
return other.toCSS && this.toCSS() === other.toCSS() ? 0 : undefined;
|
|
5674
|
-
},
|
|
5675
|
-
isRulesetLike: function () {
|
|
5676
|
-
return this.rulesetLike;
|
|
5677
|
-
},
|
|
5678
|
-
genCSS: function (context, output) {
|
|
5679
|
-
this.nodeVisible = Boolean(this.value);
|
|
5680
|
-
if (this.nodeVisible) {
|
|
5681
|
-
output.add(this.value, this._fileInfo, this._index, this.mapLines);
|
|
5682
|
-
}
|
|
5683
|
-
}
|
|
5684
|
-
});
|
|
5685
|
-
|
|
5686
5762
|
var MATH$1 = Math$1;
|
|
5687
5763
|
function evalName(context, name) {
|
|
5688
5764
|
var value = '';
|
|
@@ -5697,7 +5773,7 @@
|
|
|
5697
5773
|
var Declaration = function (name, value, important, merge, index, currentFileInfo, inline, variable) {
|
|
5698
5774
|
this.name = name;
|
|
5699
5775
|
this.value = (value instanceof Node) ? value : new Value([value ? new Anonymous(value) : null]);
|
|
5700
|
-
this.important = important ? " "
|
|
5776
|
+
this.important = important ? " ".concat(important.trim()) : '';
|
|
5701
5777
|
this.merge = merge;
|
|
5702
5778
|
this._index = index;
|
|
5703
5779
|
this._fileInfo = currentFileInfo;
|
|
@@ -5769,19 +5845,19 @@
|
|
|
5769
5845
|
});
|
|
5770
5846
|
|
|
5771
5847
|
function asComment(ctx) {
|
|
5772
|
-
return "/* line "
|
|
5848
|
+
return "/* line ".concat(ctx.debugInfo.lineNumber, ", ").concat(ctx.debugInfo.fileName, " */\n");
|
|
5773
5849
|
}
|
|
5774
5850
|
function asMediaQuery(ctx) {
|
|
5775
5851
|
var filenameWithProtocol = ctx.debugInfo.fileName;
|
|
5776
5852
|
if (!/^[a-z]+:\/\//i.test(filenameWithProtocol)) {
|
|
5777
|
-
filenameWithProtocol = "file://"
|
|
5853
|
+
filenameWithProtocol = "file://".concat(filenameWithProtocol);
|
|
5778
5854
|
}
|
|
5779
|
-
return "@media -sass-debug-info{filename{font-family:"
|
|
5855
|
+
return "@media -sass-debug-info{filename{font-family:".concat(filenameWithProtocol.replace(/([.:/\\])/g, function (a) {
|
|
5780
5856
|
if (a == '\\') {
|
|
5781
5857
|
a = '/';
|
|
5782
5858
|
}
|
|
5783
|
-
return "\\"
|
|
5784
|
-
})
|
|
5859
|
+
return "\\".concat(a);
|
|
5860
|
+
}), "}line{font-family:\\00003").concat(ctx.debugInfo.lineNumber, "}}\n");
|
|
5785
5861
|
}
|
|
5786
5862
|
function debugInfo(context, ctx, lineSeparator) {
|
|
5787
5863
|
var result = '';
|
|
@@ -6114,11 +6190,11 @@
|
|
|
6114
6190
|
var name_2 = (r.name.length === 1) && (r.name[0] instanceof Keyword) ?
|
|
6115
6191
|
r.name[0].value : r.name;
|
|
6116
6192
|
// Properties don't overwrite as they can merge
|
|
6117
|
-
if (!hash["$"
|
|
6118
|
-
hash["$"
|
|
6193
|
+
if (!hash["$".concat(name_2)]) {
|
|
6194
|
+
hash["$".concat(name_2)] = [r];
|
|
6119
6195
|
}
|
|
6120
6196
|
else {
|
|
6121
|
-
hash["$"
|
|
6197
|
+
hash["$".concat(name_2)].push(r);
|
|
6122
6198
|
}
|
|
6123
6199
|
}
|
|
6124
6200
|
return hash;
|
|
@@ -6291,7 +6367,7 @@
|
|
|
6291
6367
|
var paths = this.paths;
|
|
6292
6368
|
var pathCnt = paths.length;
|
|
6293
6369
|
var pathSubCnt = void 0;
|
|
6294
|
-
sep = context.compress ? ',' : (",\n"
|
|
6370
|
+
sep = context.compress ? ',' : (",\n".concat(tabSetStr));
|
|
6295
6371
|
for (i = 0; i < pathCnt; i++) {
|
|
6296
6372
|
path = paths[i];
|
|
6297
6373
|
if (!(pathSubCnt = path.length)) {
|
|
@@ -6326,14 +6402,14 @@
|
|
|
6326
6402
|
}
|
|
6327
6403
|
context.lastRule = currentLastRule;
|
|
6328
6404
|
if (!context.lastRule && rule.isVisible()) {
|
|
6329
|
-
output.add(context.compress ? '' : ("\n"
|
|
6405
|
+
output.add(context.compress ? '' : ("\n".concat(tabRuleStr)));
|
|
6330
6406
|
}
|
|
6331
6407
|
else {
|
|
6332
6408
|
context.lastRule = false;
|
|
6333
6409
|
}
|
|
6334
6410
|
}
|
|
6335
6411
|
if (!this.root) {
|
|
6336
|
-
output.add((context.compress ? '}' : "\n"
|
|
6412
|
+
output.add((context.compress ? '}' : "\n".concat(tabSetStr, "}")));
|
|
6337
6413
|
context.tabLevel--;
|
|
6338
6414
|
}
|
|
6339
6415
|
if (!output.isEmpty() && !context.compress && this.firstRoot) {
|
|
@@ -6688,18 +6764,18 @@
|
|
|
6688
6764
|
return;
|
|
6689
6765
|
}
|
|
6690
6766
|
// Non-compressed
|
|
6691
|
-
var tabSetStr = "\n"
|
|
6767
|
+
var tabSetStr = "\n".concat(Array(context.tabLevel).join(' ')), tabRuleStr = "".concat(tabSetStr, " ");
|
|
6692
6768
|
if (!ruleCnt) {
|
|
6693
|
-
output.add(" {"
|
|
6769
|
+
output.add(" {".concat(tabSetStr, "}"));
|
|
6694
6770
|
}
|
|
6695
6771
|
else {
|
|
6696
|
-
output.add(" {"
|
|
6772
|
+
output.add(" {".concat(tabRuleStr));
|
|
6697
6773
|
rules[0].genCSS(context, output);
|
|
6698
6774
|
for (i = 1; i < ruleCnt; i++) {
|
|
6699
6775
|
output.add(tabRuleStr);
|
|
6700
6776
|
rules[i].genCSS(context, output);
|
|
6701
6777
|
}
|
|
6702
|
-
output.add(tabSetStr
|
|
6778
|
+
output.add("".concat(tabSetStr, "}"));
|
|
6703
6779
|
}
|
|
6704
6780
|
context.tabLevel--;
|
|
6705
6781
|
}
|
|
@@ -6756,7 +6832,7 @@
|
|
|
6756
6832
|
toString: function () {
|
|
6757
6833
|
var i, returnStr = this.numerator.join('*');
|
|
6758
6834
|
for (i = 0; i < this.denominator.length; i++) {
|
|
6759
|
-
returnStr += "/"
|
|
6835
|
+
returnStr += "/".concat(this.denominator[i]);
|
|
6760
6836
|
}
|
|
6761
6837
|
return returnStr;
|
|
6762
6838
|
},
|
|
@@ -6868,7 +6944,7 @@
|
|
|
6868
6944
|
},
|
|
6869
6945
|
genCSS: function (context, output) {
|
|
6870
6946
|
if ((context && context.strictUnits) && !this.unit.isSingular()) {
|
|
6871
|
-
throw new Error("Multiple units in dimension. Correct the units or use the unit function. Bad unit: "
|
|
6947
|
+
throw new Error("Multiple units in dimension. Correct the units or use the unit function. Bad unit: ".concat(this.unit.toString()));
|
|
6872
6948
|
}
|
|
6873
6949
|
var value = this.fround(context, this.value);
|
|
6874
6950
|
var strValue = String(value);
|
|
@@ -6909,7 +6985,7 @@
|
|
|
6909
6985
|
other = other.convertTo(this.unit.usedUnits());
|
|
6910
6986
|
if (context.strictUnits && other.unit.toString() !== unit.toString()) {
|
|
6911
6987
|
throw new Error('Incompatible units. Change the units or use the unit function. '
|
|
6912
|
-
+
|
|
6988
|
+
+ "Bad units: '".concat(unit.toString(), "' and '").concat(other.unit.toString(), "'."));
|
|
6913
6989
|
}
|
|
6914
6990
|
value = this._operate(context, op, this.value, other.value);
|
|
6915
6991
|
}
|
|
@@ -7037,44 +7113,6 @@
|
|
|
7037
7113
|
}
|
|
7038
7114
|
});
|
|
7039
7115
|
|
|
7040
|
-
/*! *****************************************************************************
|
|
7041
|
-
Copyright (c) Microsoft Corporation.
|
|
7042
|
-
|
|
7043
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
7044
|
-
purpose with or without fee is hereby granted.
|
|
7045
|
-
|
|
7046
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
7047
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
7048
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
7049
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
7050
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
7051
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
7052
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
7053
|
-
***************************************************************************** */
|
|
7054
|
-
var __assign = function () {
|
|
7055
|
-
__assign = Object.assign || function __assign(t) {
|
|
7056
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
7057
|
-
s = arguments[i];
|
|
7058
|
-
for (var p in s)
|
|
7059
|
-
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7060
|
-
t[p] = s[p];
|
|
7061
|
-
}
|
|
7062
|
-
return t;
|
|
7063
|
-
};
|
|
7064
|
-
return __assign.apply(this, arguments);
|
|
7065
|
-
};
|
|
7066
|
-
function __spreadArray(to, from, pack) {
|
|
7067
|
-
if (pack || arguments.length === 2)
|
|
7068
|
-
for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
7069
|
-
if (ar || !(i in from)) {
|
|
7070
|
-
if (!ar)
|
|
7071
|
-
ar = Array.prototype.slice.call(from, 0, i);
|
|
7072
|
-
ar[i] = from[i];
|
|
7073
|
-
}
|
|
7074
|
-
}
|
|
7075
|
-
return to.concat(ar || from);
|
|
7076
|
-
}
|
|
7077
|
-
|
|
7078
7116
|
var Expression = function (value, noSpacing) {
|
|
7079
7117
|
this.value = value;
|
|
7080
7118
|
this.noSpacing = noSpacing;
|
|
@@ -7125,7 +7163,10 @@
|
|
|
7125
7163
|
for (var i_1 = 0; i_1 < this.value.length; i_1++) {
|
|
7126
7164
|
this.value[i_1].genCSS(context, output);
|
|
7127
7165
|
if (!this.noSpacing && i_1 + 1 < this.value.length) {
|
|
7128
|
-
|
|
7166
|
+
if (i_1 + 1 < this.value.length && !(this.value[i_1 + 1] instanceof Anonymous) ||
|
|
7167
|
+
this.value[i_1 + 1] instanceof Anonymous && this.value[i_1 + 1].value !== ',') {
|
|
7168
|
+
output.add(' ');
|
|
7169
|
+
}
|
|
7129
7170
|
}
|
|
7130
7171
|
}
|
|
7131
7172
|
},
|
|
@@ -7178,7 +7219,7 @@
|
|
|
7178
7219
|
return item;
|
|
7179
7220
|
});
|
|
7180
7221
|
if (evalArgs === false) {
|
|
7181
|
-
return this.func.apply(this, __spreadArray([this.context], args));
|
|
7222
|
+
return this.func.apply(this, __spreadArray([this.context], args, false));
|
|
7182
7223
|
}
|
|
7183
7224
|
return this.func.apply(this, args);
|
|
7184
7225
|
};
|
|
@@ -7243,7 +7284,7 @@
|
|
|
7243
7284
|
}
|
|
7244
7285
|
throw {
|
|
7245
7286
|
type: e.type || 'Runtime',
|
|
7246
|
-
message: "Error evaluating function `"
|
|
7287
|
+
message: "Error evaluating function `".concat(this.name, "`").concat(e.message ? ": ".concat(e.message) : ''),
|
|
7247
7288
|
index: this.getIndex(),
|
|
7248
7289
|
filename: this.fileInfo().filename,
|
|
7249
7290
|
line: e.lineNumber,
|
|
@@ -7271,7 +7312,7 @@
|
|
|
7271
7312
|
return new Call(this.name, args, this.getIndex(), this.fileInfo());
|
|
7272
7313
|
},
|
|
7273
7314
|
genCSS: function (context, output) {
|
|
7274
|
-
output.add(this.name
|
|
7315
|
+
output.add("".concat(this.name, "("), this.fileInfo(), this.getIndex());
|
|
7275
7316
|
for (var i_1 = 0; i_1 < this.args.length; i_1++) {
|
|
7276
7317
|
this.args[i_1].genCSS(context, output);
|
|
7277
7318
|
if (i_1 + 1 < this.args.length) {
|
|
@@ -7292,11 +7333,11 @@
|
|
|
7292
7333
|
eval: function (context) {
|
|
7293
7334
|
var variable, name = this.name;
|
|
7294
7335
|
if (name.indexOf('@@') === 0) {
|
|
7295
|
-
name = "@"
|
|
7336
|
+
name = "@".concat(new Variable(name.slice(1), this.getIndex(), this.fileInfo()).eval(context).value);
|
|
7296
7337
|
}
|
|
7297
7338
|
if (this.evaluating) {
|
|
7298
7339
|
throw { type: 'Name',
|
|
7299
|
-
message: "Recursive variable definition for "
|
|
7340
|
+
message: "Recursive variable definition for ".concat(name),
|
|
7300
7341
|
filename: this.fileInfo().filename,
|
|
7301
7342
|
index: this.getIndex() };
|
|
7302
7343
|
}
|
|
@@ -7323,7 +7364,7 @@
|
|
|
7323
7364
|
}
|
|
7324
7365
|
else {
|
|
7325
7366
|
throw { type: 'Name',
|
|
7326
|
-
message: "variable "
|
|
7367
|
+
message: "variable ".concat(name, " is undefined"),
|
|
7327
7368
|
filename: this.fileInfo().filename,
|
|
7328
7369
|
index: this.getIndex() };
|
|
7329
7370
|
}
|
|
@@ -7353,7 +7394,7 @@
|
|
|
7353
7394
|
var mergeRules = context.pluginManager.less.visitors.ToCSSVisitor.prototype._mergeRules;
|
|
7354
7395
|
if (this.evaluating) {
|
|
7355
7396
|
throw { type: 'Name',
|
|
7356
|
-
message: "Recursive property reference for "
|
|
7397
|
+
message: "Recursive property reference for ".concat(name),
|
|
7357
7398
|
filename: this.fileInfo().filename,
|
|
7358
7399
|
index: this.getIndex() };
|
|
7359
7400
|
}
|
|
@@ -7382,7 +7423,7 @@
|
|
|
7382
7423
|
}
|
|
7383
7424
|
else {
|
|
7384
7425
|
throw { type: 'Name',
|
|
7385
|
-
message: "Property '"
|
|
7426
|
+
message: "Property '".concat(name, "' is undefined"),
|
|
7386
7427
|
filename: this.currentFileInfo.filename,
|
|
7387
7428
|
index: this.index };
|
|
7388
7429
|
}
|
|
@@ -7421,7 +7462,7 @@
|
|
|
7421
7462
|
if (this.cif) {
|
|
7422
7463
|
value = value + ' ' + this.cif;
|
|
7423
7464
|
}
|
|
7424
|
-
return "["
|
|
7465
|
+
return "[".concat(value, "]");
|
|
7425
7466
|
}
|
|
7426
7467
|
});
|
|
7427
7468
|
|
|
@@ -7453,11 +7494,11 @@
|
|
|
7453
7494
|
var that = this;
|
|
7454
7495
|
var value = this.value;
|
|
7455
7496
|
var variableReplacement = function (_, name) {
|
|
7456
|
-
var v = new Variable("@"
|
|
7497
|
+
var v = new Variable("@".concat(name), that.getIndex(), that.fileInfo()).eval(context, true);
|
|
7457
7498
|
return (v instanceof Quoted) ? v.value : v.toCSS();
|
|
7458
7499
|
};
|
|
7459
7500
|
var propertyReplacement = function (_, name) {
|
|
7460
|
-
var v = new Property("$"
|
|
7501
|
+
var v = new Property("$".concat(name), that.getIndex(), that.fileInfo()).eval(context, true);
|
|
7461
7502
|
return (v instanceof Quoted) ? v.value : v.toCSS();
|
|
7462
7503
|
};
|
|
7463
7504
|
function iterativeReplace(value, regexp, replacementFnc) {
|
|
@@ -7484,7 +7525,7 @@
|
|
|
7484
7525
|
});
|
|
7485
7526
|
|
|
7486
7527
|
function escapePath(path) {
|
|
7487
|
-
return path.replace(/[()'"\s]/g, function (match) { return "\\"
|
|
7528
|
+
return path.replace(/[()'"\s]/g, function (match) { return "\\".concat(match); });
|
|
7488
7529
|
}
|
|
7489
7530
|
var URL = function (val, index, currentFileInfo, isEvald) {
|
|
7490
7531
|
this.value = val;
|
|
@@ -7525,7 +7566,7 @@
|
|
|
7525
7566
|
var delimiter = val.value.indexOf('?') === -1 ? '?' : '&';
|
|
7526
7567
|
var urlArgs = delimiter + context.urlArgs;
|
|
7527
7568
|
if (val.value.indexOf('#') !== -1) {
|
|
7528
|
-
val.value = val.value.replace('#', urlArgs
|
|
7569
|
+
val.value = val.value.replace('#', "".concat(urlArgs, "#"));
|
|
7529
7570
|
}
|
|
7530
7571
|
else {
|
|
7531
7572
|
val.value += urlArgs;
|
|
@@ -7569,6 +7610,10 @@
|
|
|
7569
7610
|
var path = context.mediaPath.concat([this]);
|
|
7570
7611
|
// Extract the media-query conditions separated with `,` (OR).
|
|
7571
7612
|
for (i = 0; i < path.length; i++) {
|
|
7613
|
+
if (path[i].type !== this.type) {
|
|
7614
|
+
context.mediaBlocks.splice(i, 1);
|
|
7615
|
+
return this;
|
|
7616
|
+
}
|
|
7572
7617
|
value = path[i].features instanceof Value ?
|
|
7573
7618
|
path[i].features.value : path[i].features;
|
|
7574
7619
|
path[i] = Array.isArray(value) ? value : [value];
|
|
@@ -7828,13 +7873,13 @@
|
|
|
7828
7873
|
index: this.getIndex() };
|
|
7829
7874
|
}
|
|
7830
7875
|
expression = expression.replace(/@\{([\w-]+)\}/g, function (_, name) {
|
|
7831
|
-
return that.jsify(new Variable("@"
|
|
7876
|
+
return that.jsify(new Variable("@".concat(name), that.getIndex(), that.fileInfo()).eval(context));
|
|
7832
7877
|
});
|
|
7833
7878
|
try {
|
|
7834
|
-
expression = new Function("return ("
|
|
7879
|
+
expression = new Function("return (".concat(expression, ")"));
|
|
7835
7880
|
}
|
|
7836
7881
|
catch (e) {
|
|
7837
|
-
throw { message: "JavaScript evaluation error: "
|
|
7882
|
+
throw { message: "JavaScript evaluation error: ".concat(e.message, " from `").concat(expression, "`"),
|
|
7838
7883
|
filename: this.fileInfo().filename,
|
|
7839
7884
|
index: this.getIndex() };
|
|
7840
7885
|
}
|
|
@@ -7854,7 +7899,7 @@
|
|
|
7854
7899
|
result = expression.call(evalContext);
|
|
7855
7900
|
}
|
|
7856
7901
|
catch (e) {
|
|
7857
|
-
throw { message: "JavaScript evaluation error: '"
|
|
7902
|
+
throw { message: "JavaScript evaluation error: '".concat(e.name, ": ").concat(e.message.replace(/["]/g, '\''), "'"),
|
|
7858
7903
|
filename: this.fileInfo().filename,
|
|
7859
7904
|
index: this.getIndex() };
|
|
7860
7905
|
}
|
|
@@ -7862,7 +7907,7 @@
|
|
|
7862
7907
|
},
|
|
7863
7908
|
jsify: function (obj) {
|
|
7864
7909
|
if (Array.isArray(obj.value) && (obj.value.length > 1)) {
|
|
7865
|
-
return "["
|
|
7910
|
+
return "[".concat(obj.value.map(function (v) { return v.toCSS(); }).join(', '), "]");
|
|
7866
7911
|
}
|
|
7867
7912
|
else {
|
|
7868
7913
|
return obj.toCSS();
|
|
@@ -7885,7 +7930,7 @@
|
|
|
7885
7930
|
return new Dimension(result);
|
|
7886
7931
|
}
|
|
7887
7932
|
else if (type === 'string') {
|
|
7888
|
-
return new Quoted("\""
|
|
7933
|
+
return new Quoted("\"".concat(result, "\""), result, this.escaped, this._index);
|
|
7889
7934
|
}
|
|
7890
7935
|
else if (Array.isArray(result)) {
|
|
7891
7936
|
return new Anonymous(result.join(', '));
|
|
@@ -7912,7 +7957,7 @@
|
|
|
7912
7957
|
return this;
|
|
7913
7958
|
},
|
|
7914
7959
|
genCSS: function (context, output) {
|
|
7915
|
-
output.add(this.key
|
|
7960
|
+
output.add("".concat(this.key, "="));
|
|
7916
7961
|
if (this.value.genCSS) {
|
|
7917
7962
|
this.value.genCSS(context, output);
|
|
7918
7963
|
}
|
|
@@ -7964,6 +8009,7 @@
|
|
|
7964
8009
|
this.op2 = op2 ? op2.trim() : null;
|
|
7965
8010
|
this.rvalue = r;
|
|
7966
8011
|
this._index = i;
|
|
8012
|
+
this.mvalues = [];
|
|
7967
8013
|
};
|
|
7968
8014
|
QueryInParens.prototype = Object.assign(new Node(), {
|
|
7969
8015
|
type: 'QueryInParens',
|
|
@@ -7976,7 +8022,32 @@
|
|
|
7976
8022
|
},
|
|
7977
8023
|
eval: function (context) {
|
|
7978
8024
|
this.lvalue = this.lvalue.eval(context);
|
|
7979
|
-
|
|
8025
|
+
var variableDeclaration;
|
|
8026
|
+
var rule;
|
|
8027
|
+
for (var i_1 = 0; (rule = context.frames[i_1]); i_1++) {
|
|
8028
|
+
if (rule.type === 'Ruleset') {
|
|
8029
|
+
variableDeclaration = rule.rules.find(function (r) {
|
|
8030
|
+
if ((r instanceof Declaration) && r.variable) {
|
|
8031
|
+
return true;
|
|
8032
|
+
}
|
|
8033
|
+
return false;
|
|
8034
|
+
});
|
|
8035
|
+
if (variableDeclaration) {
|
|
8036
|
+
break;
|
|
8037
|
+
}
|
|
8038
|
+
}
|
|
8039
|
+
}
|
|
8040
|
+
if (!this.mvalueCopy) {
|
|
8041
|
+
this.mvalueCopy = copy(this.mvalue);
|
|
8042
|
+
}
|
|
8043
|
+
if (variableDeclaration) {
|
|
8044
|
+
this.mvalue = this.mvalueCopy;
|
|
8045
|
+
this.mvalue = this.mvalue.eval(context);
|
|
8046
|
+
this.mvalues.push(this.mvalue);
|
|
8047
|
+
}
|
|
8048
|
+
else {
|
|
8049
|
+
this.mvalue = this.mvalue.eval(context);
|
|
8050
|
+
}
|
|
7980
8051
|
if (this.rvalue) {
|
|
7981
8052
|
this.rvalue = this.rvalue.eval(context);
|
|
7982
8053
|
}
|
|
@@ -7985,6 +8056,9 @@
|
|
|
7985
8056
|
genCSS: function (context, output) {
|
|
7986
8057
|
this.lvalue.genCSS(context, output);
|
|
7987
8058
|
output.add(' ' + this.op + ' ');
|
|
8059
|
+
if (this.mvalues.length > 0) {
|
|
8060
|
+
this.mvalue = this.mvalues.shift();
|
|
8061
|
+
}
|
|
7988
8062
|
this.mvalue.genCSS(context, output);
|
|
7989
8063
|
if (this.rvalue) {
|
|
7990
8064
|
output.add(' ' + this.op2 + ' ');
|
|
@@ -8119,7 +8193,7 @@
|
|
|
8119
8193
|
eval: function (context) {
|
|
8120
8194
|
var rules;
|
|
8121
8195
|
var detachedRuleset = new Variable(this.variable, this.getIndex(), this.fileInfo()).eval(context);
|
|
8122
|
-
var error = new LessError({ message: "Could not evaluate variable call "
|
|
8196
|
+
var error = new LessError({ message: "Could not evaluate variable call ".concat(this.variable) });
|
|
8123
8197
|
if (!detachedRuleset.ruleset) {
|
|
8124
8198
|
if (detachedRuleset.rules) {
|
|
8125
8199
|
rules = detachedRuleset;
|
|
@@ -8167,31 +8241,31 @@
|
|
|
8167
8241
|
}
|
|
8168
8242
|
else if (name.charAt(0) === '@') {
|
|
8169
8243
|
if (name.charAt(1) === '@') {
|
|
8170
|
-
name = "@"
|
|
8244
|
+
name = "@".concat(new Variable(name.substr(1)).eval(context).value);
|
|
8171
8245
|
}
|
|
8172
8246
|
if (rules.variables) {
|
|
8173
8247
|
rules = rules.variable(name);
|
|
8174
8248
|
}
|
|
8175
8249
|
if (!rules) {
|
|
8176
8250
|
throw { type: 'Name',
|
|
8177
|
-
message: "variable "
|
|
8251
|
+
message: "variable ".concat(name, " not found"),
|
|
8178
8252
|
filename: this.fileInfo().filename,
|
|
8179
8253
|
index: this.getIndex() };
|
|
8180
8254
|
}
|
|
8181
8255
|
}
|
|
8182
8256
|
else {
|
|
8183
8257
|
if (name.substring(0, 2) === '$@') {
|
|
8184
|
-
name = "$"
|
|
8258
|
+
name = "$".concat(new Variable(name.substr(1)).eval(context).value);
|
|
8185
8259
|
}
|
|
8186
8260
|
else {
|
|
8187
|
-
name = name.charAt(0) === '$' ? name : "$"
|
|
8261
|
+
name = name.charAt(0) === '$' ? name : "$".concat(name);
|
|
8188
8262
|
}
|
|
8189
8263
|
if (rules.properties) {
|
|
8190
8264
|
rules = rules.property(name);
|
|
8191
8265
|
}
|
|
8192
8266
|
if (!rules) {
|
|
8193
8267
|
throw { type: 'Name',
|
|
8194
|
-
message: "property \""
|
|
8268
|
+
message: "property \"".concat(name.substr(1), "\" not found"),
|
|
8195
8269
|
filename: this.fileInfo().filename,
|
|
8196
8270
|
index: this.getIndex() };
|
|
8197
8271
|
}
|
|
@@ -8284,7 +8358,7 @@
|
|
|
8284
8358
|
continue;
|
|
8285
8359
|
}
|
|
8286
8360
|
else {
|
|
8287
|
-
throw { type: 'Runtime', message: "Named argument for "
|
|
8361
|
+
throw { type: 'Runtime', message: "Named argument for ".concat(this.name, " ").concat(args[i].name, " not found") };
|
|
8288
8362
|
}
|
|
8289
8363
|
}
|
|
8290
8364
|
}
|
|
@@ -8319,7 +8393,7 @@
|
|
|
8319
8393
|
frame.resetCache();
|
|
8320
8394
|
}
|
|
8321
8395
|
else {
|
|
8322
|
-
throw { type: 'Runtime', message: "wrong number of arguments for "
|
|
8396
|
+
throw { type: 'Runtime', message: "wrong number of arguments for ".concat(this.name, " (").concat(argsLength, " for ").concat(this.arity, ")") };
|
|
8323
8397
|
}
|
|
8324
8398
|
frame.prependRule(new Declaration(name, val));
|
|
8325
8399
|
evaldArguments[i] = val;
|
|
@@ -8534,7 +8608,7 @@
|
|
|
8534
8608
|
defaultResult = defTrue;
|
|
8535
8609
|
if ((count[defTrue] + count[defFalse]) > 1) {
|
|
8536
8610
|
throw { type: 'Runtime',
|
|
8537
|
-
message: "Ambiguous use of `default()` found when matching for `"
|
|
8611
|
+
message: "Ambiguous use of `default()` found when matching for `".concat(this.format(args), "`"),
|
|
8538
8612
|
index: this.getIndex(), filename: this.fileInfo().filename };
|
|
8539
8613
|
}
|
|
8540
8614
|
}
|
|
@@ -8564,12 +8638,12 @@
|
|
|
8564
8638
|
}
|
|
8565
8639
|
if (isOneFound) {
|
|
8566
8640
|
throw { type: 'Runtime',
|
|
8567
|
-
message: "No matching definition was found for `"
|
|
8641
|
+
message: "No matching definition was found for `".concat(this.format(args), "`"),
|
|
8568
8642
|
index: this.getIndex(), filename: this.fileInfo().filename };
|
|
8569
8643
|
}
|
|
8570
8644
|
else {
|
|
8571
8645
|
throw { type: 'Name',
|
|
8572
|
-
message: this.selector.toCSS().trim()
|
|
8646
|
+
message: "".concat(this.selector.toCSS().trim(), " is undefined"),
|
|
8573
8647
|
index: this.getIndex(), filename: this.fileInfo().filename };
|
|
8574
8648
|
}
|
|
8575
8649
|
},
|
|
@@ -8583,10 +8657,10 @@
|
|
|
8583
8657
|
}
|
|
8584
8658
|
},
|
|
8585
8659
|
format: function (args) {
|
|
8586
|
-
return this.selector.toCSS().trim()
|
|
8660
|
+
return "".concat(this.selector.toCSS().trim(), "(").concat(args ? args.map(function (a) {
|
|
8587
8661
|
var argValue = '';
|
|
8588
8662
|
if (a.name) {
|
|
8589
|
-
argValue += a.name
|
|
8663
|
+
argValue += "".concat(a.name, ":");
|
|
8590
8664
|
}
|
|
8591
8665
|
if (a.value.toCSS) {
|
|
8592
8666
|
argValue += a.value.toCSS();
|
|
@@ -8595,7 +8669,7 @@
|
|
|
8595
8669
|
argValue += '???';
|
|
8596
8670
|
}
|
|
8597
8671
|
return argValue;
|
|
8598
|
-
}).join(', ') : ''
|
|
8672
|
+
}).join(', ') : '', ")");
|
|
8599
8673
|
}
|
|
8600
8674
|
});
|
|
8601
8675
|
|
|
@@ -8705,7 +8779,7 @@
|
|
|
8705
8779
|
diff += '../';
|
|
8706
8780
|
}
|
|
8707
8781
|
for (i = 0; i < urlDirectories.length - 1; i++) {
|
|
8708
|
-
diff += urlDirectories[i]
|
|
8782
|
+
diff += "".concat(urlDirectories[i], "/");
|
|
8709
8783
|
}
|
|
8710
8784
|
return diff;
|
|
8711
8785
|
};
|
|
@@ -8730,13 +8804,13 @@
|
|
|
8730
8804
|
var i;
|
|
8731
8805
|
var baseUrlParts;
|
|
8732
8806
|
if (!urlParts) {
|
|
8733
|
-
throw new Error("Could not parse sheet href - '"
|
|
8807
|
+
throw new Error("Could not parse sheet href - '".concat(url, "'"));
|
|
8734
8808
|
}
|
|
8735
8809
|
// Stylesheets in IE don't always return the full path
|
|
8736
8810
|
if (baseUrl && (!urlParts[1] || urlParts[2])) {
|
|
8737
8811
|
baseUrlParts = baseUrl.match(urlPartsRegex);
|
|
8738
8812
|
if (!baseUrlParts) {
|
|
8739
|
-
throw new Error("Could not parse page url - '"
|
|
8813
|
+
throw new Error("Could not parse page url - '".concat(baseUrl, "'"));
|
|
8740
8814
|
}
|
|
8741
8815
|
urlParts[1] = urlParts[1] || baseUrlParts[1] || '';
|
|
8742
8816
|
if (!urlParts[2]) {
|
|
@@ -8865,7 +8939,7 @@
|
|
|
8865
8939
|
AbstractPluginLoader.prototype.trySetOptions = function (plugin, filename, name, options) {
|
|
8866
8940
|
if (options && !plugin.setOptions) {
|
|
8867
8941
|
return new LessError({
|
|
8868
|
-
message: "Options have been provided but the plugin "
|
|
8942
|
+
message: "Options have been provided but the plugin ".concat(name, " does not support any options.")
|
|
8869
8943
|
});
|
|
8870
8944
|
}
|
|
8871
8945
|
try {
|
|
@@ -8885,7 +8959,7 @@
|
|
|
8885
8959
|
if (plugin.minVersion) {
|
|
8886
8960
|
if (this.compareVersion(plugin.minVersion, this.less.version) < 0) {
|
|
8887
8961
|
return new LessError({
|
|
8888
|
-
message: "Plugin "
|
|
8962
|
+
message: "Plugin ".concat(name, " requires version ").concat(this.versionToString(plugin.minVersion))
|
|
8889
8963
|
});
|
|
8890
8964
|
}
|
|
8891
8965
|
}
|
|
@@ -9354,7 +9428,7 @@
|
|
|
9354
9428
|
if ((c instanceof Quoted) &&
|
|
9355
9429
|
(/^#([A-Fa-f0-9]{8}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3,4})$/i.test(c.value))) {
|
|
9356
9430
|
var val = c.value.slice(1);
|
|
9357
|
-
return new Color(val, undefined, "#"
|
|
9431
|
+
return new Color(val, undefined, "#".concat(val));
|
|
9358
9432
|
}
|
|
9359
9433
|
if ((c instanceof Color) || (c = Color.fromKeyword(c.value))) {
|
|
9360
9434
|
c.value = undefined;
|
|
@@ -9491,7 +9565,7 @@
|
|
|
9491
9565
|
}
|
|
9492
9566
|
var fileSync = fileManager.loadFileSync(filePath, currentDirectory, context, environment);
|
|
9493
9567
|
if (!fileSync.contents) {
|
|
9494
|
-
logger$1.warn("Skipped data-uri embedding of "
|
|
9568
|
+
logger$1.warn("Skipped data-uri embedding of ".concat(filePath, " because file not found"));
|
|
9495
9569
|
return fallback(this, filePathNode || mimetypeNode);
|
|
9496
9570
|
}
|
|
9497
9571
|
var buf = fileSync.contents;
|
|
@@ -9499,8 +9573,8 @@
|
|
|
9499
9573
|
return fallback(this, filePathNode);
|
|
9500
9574
|
}
|
|
9501
9575
|
buf = useBase64 ? environment.encodeBase64(buf) : encodeURIComponent(buf);
|
|
9502
|
-
var uri = "data:"
|
|
9503
|
-
return new URL(new Quoted("\""
|
|
9576
|
+
var uri = "data:".concat(mimetype, ",").concat(buf).concat(fragment);
|
|
9577
|
+
return new URL(new Quoted("\"".concat(uri, "\""), uri, false, this.index, this.currentFileInfo), this.index, this.currentFileInfo);
|
|
9504
9578
|
} };
|
|
9505
9579
|
});
|
|
9506
9580
|
|
|
@@ -9696,8 +9770,11 @@
|
|
|
9696
9770
|
if (!(current instanceof Dimension)) {
|
|
9697
9771
|
if (Array.isArray(args[i].value)) {
|
|
9698
9772
|
Array.prototype.push.apply(args, Array.prototype.slice.call(args[i].value));
|
|
9773
|
+
continue;
|
|
9774
|
+
}
|
|
9775
|
+
else {
|
|
9776
|
+
throw { type: 'Argument', message: 'incompatible types' };
|
|
9699
9777
|
}
|
|
9700
|
-
continue;
|
|
9701
9778
|
}
|
|
9702
9779
|
currentUnified = current.unit.toString() === '' && unitClone !== undefined ? new Dimension(current.value, unitClone).unify() : current.unify();
|
|
9703
9780
|
unit = currentUnified.unit.toString() === '' && unitStatic !== undefined ? unitStatic : currentUnified.unit.toString();
|
|
@@ -9722,7 +9799,7 @@
|
|
|
9722
9799
|
return order[0];
|
|
9723
9800
|
}
|
|
9724
9801
|
args = order.map(function (a) { return a.toCSS(_this.context); }).join(this.context.compress ? ',' : ', ');
|
|
9725
|
-
return new Anonymous((isMin ? 'min' : 'max'
|
|
9802
|
+
return new Anonymous("".concat(isMin ? 'min' : 'max', "(").concat(args, ")"));
|
|
9726
9803
|
};
|
|
9727
9804
|
var number = {
|
|
9728
9805
|
min: function () {
|
|
@@ -9858,7 +9935,7 @@
|
|
|
9858
9935
|
throw { type: 'Argument', message: 'svg-gradient direction must be \'to bottom\', \'to right\',' +
|
|
9859
9936
|
' \'to bottom right\', \'to top right\' or \'ellipse at center\'' };
|
|
9860
9937
|
}
|
|
9861
|
-
returner = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 1 1\"><"
|
|
9938
|
+
returner = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 1 1\"><".concat(gradientType, "Gradient id=\"g\" ").concat(gradientDirectionSvg, ">");
|
|
9862
9939
|
for (i = 0; i < stops.length; i += 1) {
|
|
9863
9940
|
if (stops[i] instanceof Expression) {
|
|
9864
9941
|
color = stops[i].value[0];
|
|
@@ -9873,12 +9950,12 @@
|
|
|
9873
9950
|
}
|
|
9874
9951
|
positionValue = position ? position.toCSS(renderEnv) : i === 0 ? '0%' : '100%';
|
|
9875
9952
|
alpha = color.alpha;
|
|
9876
|
-
returner += "<stop offset=\""
|
|
9953
|
+
returner += "<stop offset=\"".concat(positionValue, "\" stop-color=\"").concat(color.toRGB(), "\"").concat(alpha < 1 ? " stop-opacity=\"".concat(alpha, "\"") : '', "/>");
|
|
9877
9954
|
}
|
|
9878
|
-
returner += "</"
|
|
9955
|
+
returner += "</".concat(gradientType, "Gradient><rect ").concat(rectangleDimension, " fill=\"url(#g)\" /></svg>");
|
|
9879
9956
|
returner = encodeURIComponent(returner);
|
|
9880
|
-
returner = "data:image/svg+xml,"
|
|
9881
|
-
return new URL(new Quoted("'"
|
|
9957
|
+
returner = "data:image/svg+xml,".concat(returner);
|
|
9958
|
+
return new URL(new Quoted("'".concat(returner, "'"), returner, false, this.index, this.currentFileInfo), this.index, this.currentFileInfo);
|
|
9882
9959
|
} };
|
|
9883
9960
|
});
|
|
9884
9961
|
|
|
@@ -9925,7 +10002,7 @@
|
|
|
9925
10002
|
unit: function (val, unit) {
|
|
9926
10003
|
if (!(val instanceof Dimension)) {
|
|
9927
10004
|
throw { type: 'Argument',
|
|
9928
|
-
message: "the first argument to unit must be a number"
|
|
10005
|
+
message: "the first argument to unit must be a number".concat(val instanceof Operation ? '. Have you forgotten parenthesis?' : '') };
|
|
9929
10006
|
}
|
|
9930
10007
|
if (unit) {
|
|
9931
10008
|
if (unit instanceof Keyword) {
|
|
@@ -9945,6 +10022,29 @@
|
|
|
9945
10022
|
}
|
|
9946
10023
|
};
|
|
9947
10024
|
|
|
10025
|
+
var styleExpression = function (args) {
|
|
10026
|
+
var _this = this;
|
|
10027
|
+
args = Array.prototype.slice.call(args);
|
|
10028
|
+
switch (args.length) {
|
|
10029
|
+
case 0: throw { type: 'Argument', message: 'one or more arguments required' };
|
|
10030
|
+
}
|
|
10031
|
+
var entityList = [new Variable(args[0].value, this.index, this.currentFileInfo).eval(this.context)];
|
|
10032
|
+
args = entityList.map(function (a) { return a.toCSS(_this.context); }).join(this.context.compress ? ',' : ', ');
|
|
10033
|
+
return new Variable("style(".concat(args, ")"));
|
|
10034
|
+
};
|
|
10035
|
+
var style$1 = {
|
|
10036
|
+
style: function () {
|
|
10037
|
+
var args = [];
|
|
10038
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
10039
|
+
args[_i] = arguments[_i];
|
|
10040
|
+
}
|
|
10041
|
+
try {
|
|
10042
|
+
return styleExpression.call(this, args);
|
|
10043
|
+
}
|
|
10044
|
+
catch (e) { }
|
|
10045
|
+
},
|
|
10046
|
+
};
|
|
10047
|
+
|
|
9948
10048
|
var functions = (function (environment) {
|
|
9949
10049
|
var functions = { functionRegistry: functionRegistry, functionCaller: functionCaller };
|
|
9950
10050
|
// register functions
|
|
@@ -9959,6 +10059,7 @@
|
|
|
9959
10059
|
functionRegistry.addMultiple(string);
|
|
9960
10060
|
functionRegistry.addMultiple(svg());
|
|
9961
10061
|
functionRegistry.addMultiple(types);
|
|
10062
|
+
functionRegistry.addMultiple(style$1);
|
|
9962
10063
|
return functions;
|
|
9963
10064
|
});
|
|
9964
10065
|
|
|
@@ -9989,7 +10090,7 @@
|
|
|
9989
10090
|
}
|
|
9990
10091
|
value = new tree.Value([value]);
|
|
9991
10092
|
}
|
|
9992
|
-
return new tree.Declaration("@"
|
|
10093
|
+
return new tree.Declaration("@".concat(k), value, false, null, 0);
|
|
9993
10094
|
});
|
|
9994
10095
|
evalEnv.frames = [new tree.Ruleset(null, variables)];
|
|
9995
10096
|
}
|
|
@@ -10372,13 +10473,13 @@
|
|
|
10372
10473
|
if (this.sourceMap === undefined) {
|
|
10373
10474
|
return '';
|
|
10374
10475
|
}
|
|
10375
|
-
sourceMapURL = "data:application/json;base64,"
|
|
10476
|
+
sourceMapURL = "data:application/json;base64,".concat(environment.encodeBase64(this.sourceMap));
|
|
10376
10477
|
}
|
|
10377
10478
|
if (this.options.disableSourcemapAnnotation) {
|
|
10378
10479
|
return '';
|
|
10379
10480
|
}
|
|
10380
10481
|
if (sourceMapURL) {
|
|
10381
|
-
return "/*# sourceMappingURL="
|
|
10482
|
+
return "/*# sourceMappingURL=".concat(sourceMapURL, " */");
|
|
10382
10483
|
}
|
|
10383
10484
|
return '';
|
|
10384
10485
|
};
|
|
@@ -10505,7 +10606,7 @@
|
|
|
10505
10606
|
var importedEqualsRoot = fullPath === importManager.rootFilename;
|
|
10506
10607
|
if (importOptions.optional && e) {
|
|
10507
10608
|
callback(null, { rules: [] }, false, null);
|
|
10508
|
-
logger$1.info("The file "
|
|
10609
|
+
logger$1.info("The file ".concat(fullPath, " was skipped because it was not found and the import was marked optional."));
|
|
10509
10610
|
}
|
|
10510
10611
|
else {
|
|
10511
10612
|
// Inline imports aren't cached here.
|
|
@@ -10528,7 +10629,7 @@
|
|
|
10528
10629
|
};
|
|
10529
10630
|
var fileManager = environment.getFileManager(path, currentFileInfo.currentDirectory, this.context, environment);
|
|
10530
10631
|
if (!fileManager) {
|
|
10531
|
-
fileParsedFunc({ message: "Could not find a file-manager for "
|
|
10632
|
+
fileParsedFunc({ message: "Could not find a file-manager for ".concat(path) });
|
|
10532
10633
|
return;
|
|
10533
10634
|
}
|
|
10534
10635
|
var loadFileCallback = function (loadedFile) {
|
|
@@ -10751,7 +10852,7 @@
|
|
|
10751
10852
|
return render;
|
|
10752
10853
|
}
|
|
10753
10854
|
|
|
10754
|
-
var version = "4.2.
|
|
10855
|
+
var version = "4.2.2";
|
|
10755
10856
|
|
|
10756
10857
|
function parseNodeVersion(version) {
|
|
10757
10858
|
var match = version.match(/^v(\d{1,2})\.(\d{1,2})\.(\d{1,2})(?:-([0-9A-Za-z-.]+))?(?:\+([0-9A-Za-z-.]+))?$/); // eslint-disable-line max-len
|
|
@@ -10778,7 +10879,7 @@
|
|
|
10778
10879
|
importManager = ImportManager(environment);
|
|
10779
10880
|
var render = Render(environment, parseTree);
|
|
10780
10881
|
var parse = Parse(environment, parseTree, importManager);
|
|
10781
|
-
var v = parseNodeVersion_1("v"
|
|
10882
|
+
var v = parseNodeVersion_1("v".concat(version));
|
|
10782
10883
|
var initial = {
|
|
10783
10884
|
version: [v.major, v.minor, v.patch],
|
|
10784
10885
|
data: data,
|
|
@@ -10859,7 +10960,7 @@
|
|
|
10859
10960
|
if (typeof xhr.overrideMimeType === 'function') {
|
|
10860
10961
|
xhr.overrideMimeType('text/css');
|
|
10861
10962
|
}
|
|
10862
|
-
logger.debug("XHR: Getting '"
|
|
10963
|
+
logger.debug("XHR: Getting '".concat(url, "'"));
|
|
10863
10964
|
xhr.open('GET', url, async);
|
|
10864
10965
|
xhr.setRequestHeader('Accept', type || 'text/x-less, text/css; q=0.9, */*; q=0.5');
|
|
10865
10966
|
xhr.send(null);
|
|
@@ -10916,7 +11017,7 @@
|
|
|
10916
11017
|
return resolve({ contents: lessText_1, filename: href, webInfo: { lastModified: new Date() } });
|
|
10917
11018
|
}
|
|
10918
11019
|
catch (e) {
|
|
10919
|
-
return reject({ filename: href, message: "Error loading file "
|
|
11020
|
+
return reject({ filename: href, message: "Error loading file ".concat(href, " error was ").concat(e.message) });
|
|
10920
11021
|
}
|
|
10921
11022
|
}
|
|
10922
11023
|
self.doXHR(href, options.mime, function doXHRCallback(data, lastModified) {
|
|
@@ -10925,7 +11026,7 @@
|
|
|
10925
11026
|
// Use remote copy (re-parse)
|
|
10926
11027
|
resolve({ contents: data, filename: href, webInfo: { lastModified: lastModified } });
|
|
10927
11028
|
}, function doXHRError(status, url) {
|
|
10928
|
-
reject({ type: 'File', message: "'"
|
|
11029
|
+
reject({ type: 'File', message: "'".concat(url, "' wasn't found (").concat(status, ")"), href: href });
|
|
10929
11030
|
});
|
|
10930
11031
|
});
|
|
10931
11032
|
}
|
|
@@ -10998,7 +11099,7 @@
|
|
|
10998
11099
|
|
|
10999
11100
|
var ErrorReporting = (function (window, less, options) {
|
|
11000
11101
|
function errorHTML(e, rootHref) {
|
|
11001
|
-
var id = "less-error-message:"
|
|
11102
|
+
var id = "less-error-message:".concat(extractId(rootHref || ''));
|
|
11002
11103
|
var template = '<li><label>{line}</label><pre class="{class}">{content}</pre></li>';
|
|
11003
11104
|
var elem = window.document.createElement('div');
|
|
11004
11105
|
var timer;
|
|
@@ -11008,8 +11109,8 @@
|
|
|
11008
11109
|
var filenameNoPath = filename.match(/([^/]+(\?.*)?)$/)[1];
|
|
11009
11110
|
elem.id = id;
|
|
11010
11111
|
elem.className = 'less-error-message';
|
|
11011
|
-
content = "<h3>"
|
|
11012
|
-
|
|
11112
|
+
content = "<h3>".concat(e.type || 'Syntax', "Error: ").concat(e.message || 'There is an error in your .less file') +
|
|
11113
|
+
"</h3><p>in <a href=\"".concat(filename, "\">").concat(filenameNoPath, "</a> ");
|
|
11013
11114
|
var errorline = function (e, i, classname) {
|
|
11014
11115
|
if (e.extract[i] !== undefined) {
|
|
11015
11116
|
errors.push(template.replace(/\{line\}/, (parseInt(e.line, 10) || 0) + (i - 1))
|
|
@@ -11021,10 +11122,10 @@
|
|
|
11021
11122
|
errorline(e, 0, '');
|
|
11022
11123
|
errorline(e, 1, 'line');
|
|
11023
11124
|
errorline(e, 2, '');
|
|
11024
|
-
content += "on line "
|
|
11125
|
+
content += "on line ".concat(e.line, ", column ").concat(e.column + 1, ":</p><ul>").concat(errors.join(''), "</ul>");
|
|
11025
11126
|
}
|
|
11026
11127
|
if (e.stack && (e.extract || options.logLevel >= 4)) {
|
|
11027
|
-
content += "<br/>Stack Trace</br />"
|
|
11128
|
+
content += "<br/>Stack Trace</br />".concat(e.stack.split('\n').slice(1).join('<br/>'));
|
|
11028
11129
|
}
|
|
11029
11130
|
elem.innerHTML = content;
|
|
11030
11131
|
// CSS for error messages
|
|
@@ -11094,7 +11195,7 @@
|
|
|
11094
11195
|
}
|
|
11095
11196
|
}
|
|
11096
11197
|
function removeErrorHTML(path) {
|
|
11097
|
-
var node = window.document.getElementById("less-error-message:"
|
|
11198
|
+
var node = window.document.getElementById("less-error-message:".concat(extractId(path)));
|
|
11098
11199
|
if (node) {
|
|
11099
11200
|
node.parentNode.removeChild(node);
|
|
11100
11201
|
}
|
|
@@ -11112,7 +11213,7 @@
|
|
|
11112
11213
|
var template = '{line} {content}';
|
|
11113
11214
|
var filename = e.filename || rootHref;
|
|
11114
11215
|
var errors = [];
|
|
11115
|
-
var content = (e.type || 'Syntax'
|
|
11216
|
+
var content = "".concat(e.type || 'Syntax', "Error: ").concat(e.message || 'There is an error in your .less file', " in ").concat(filename);
|
|
11116
11217
|
var errorline = function (e, i, classname) {
|
|
11117
11218
|
if (e.extract[i] !== undefined) {
|
|
11118
11219
|
errors.push(template.replace(/\{line\}/, (parseInt(e.line, 10) || 0) + (i - 1))
|
|
@@ -11124,10 +11225,10 @@
|
|
|
11124
11225
|
errorline(e, 0, '');
|
|
11125
11226
|
errorline(e, 1, 'line');
|
|
11126
11227
|
errorline(e, 2, '');
|
|
11127
|
-
content += " on line "
|
|
11228
|
+
content += " on line ".concat(e.line, ", column ").concat(e.column + 1, ":\n").concat(errors.join('\n'));
|
|
11128
11229
|
}
|
|
11129
11230
|
if (e.stack && (e.extract || options.logLevel >= 4)) {
|
|
11130
|
-
content += "\nStack Trace\n"
|
|
11231
|
+
content += "\nStack Trace\n".concat(e.stack);
|
|
11131
11232
|
}
|
|
11132
11233
|
less.logger.error(content);
|
|
11133
11234
|
}
|
|
@@ -11160,24 +11261,24 @@
|
|
|
11160
11261
|
return {
|
|
11161
11262
|
setCSS: function (path, lastModified, modifyVars, styles) {
|
|
11162
11263
|
if (cache) {
|
|
11163
|
-
logger.info("saving "
|
|
11264
|
+
logger.info("saving ".concat(path, " to cache."));
|
|
11164
11265
|
try {
|
|
11165
11266
|
cache.setItem(path, styles);
|
|
11166
|
-
cache.setItem(path
|
|
11267
|
+
cache.setItem("".concat(path, ":timestamp"), lastModified);
|
|
11167
11268
|
if (modifyVars) {
|
|
11168
|
-
cache.setItem(path
|
|
11269
|
+
cache.setItem("".concat(path, ":vars"), JSON.stringify(modifyVars));
|
|
11169
11270
|
}
|
|
11170
11271
|
}
|
|
11171
11272
|
catch (e) {
|
|
11172
11273
|
// TODO - could do with adding more robust error handling
|
|
11173
|
-
logger.error("failed to save \""
|
|
11274
|
+
logger.error("failed to save \"".concat(path, "\" to local storage for caching."));
|
|
11174
11275
|
}
|
|
11175
11276
|
}
|
|
11176
11277
|
},
|
|
11177
11278
|
getCSS: function (path, webInfo, modifyVars) {
|
|
11178
11279
|
var css = cache && cache.getItem(path);
|
|
11179
|
-
var timestamp = cache && cache.getItem(path
|
|
11180
|
-
var vars = cache && cache.getItem(path
|
|
11280
|
+
var timestamp = cache && cache.getItem("".concat(path, ":timestamp"));
|
|
11281
|
+
var vars = cache && cache.getItem("".concat(path, ":vars"));
|
|
11181
11282
|
modifyVars = modifyVars || {};
|
|
11182
11283
|
vars = vars || '{}'; // if not set, treat as the JSON representation of an empty object
|
|
11183
11284
|
if (timestamp && webInfo.lastModified &&
|
|
@@ -11428,19 +11529,19 @@
|
|
|
11428
11529
|
return;
|
|
11429
11530
|
}
|
|
11430
11531
|
if (webInfo.local) {
|
|
11431
|
-
less.logger.info("Loading "
|
|
11532
|
+
less.logger.info("Loading ".concat(sheet.href, " from cache."));
|
|
11432
11533
|
}
|
|
11433
11534
|
else {
|
|
11434
|
-
less.logger.info("Rendered "
|
|
11535
|
+
less.logger.info("Rendered ".concat(sheet.href, " successfully."));
|
|
11435
11536
|
}
|
|
11436
11537
|
browser.createCSS(window.document, css, sheet);
|
|
11437
|
-
less.logger.info("CSS for "
|
|
11538
|
+
less.logger.info("CSS for ".concat(sheet.href, " generated in ").concat(new Date() - endTime, "ms"));
|
|
11438
11539
|
// Count completed sheet
|
|
11439
11540
|
remainingSheets--;
|
|
11440
11541
|
// Check if the last remaining sheet was processed and then call the promise
|
|
11441
11542
|
if (remainingSheets === 0) {
|
|
11442
11543
|
totalMilliseconds = new Date() - startTime;
|
|
11443
|
-
less.logger.info("Less has finished. CSS generated in "
|
|
11544
|
+
less.logger.info("Less has finished. CSS generated in ".concat(totalMilliseconds, "ms"));
|
|
11444
11545
|
resolve({
|
|
11445
11546
|
startTime: startTime,
|
|
11446
11547
|
endTime: endTime,
|
|
@@ -11514,4 +11615,4 @@
|
|
|
11514
11615
|
|
|
11515
11616
|
return less;
|
|
11516
11617
|
|
|
11517
|
-
}))
|
|
11618
|
+
}));
|