less 1.4.0-b3 → 1.4.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/.npmignore +1 -0
- package/CHANGELOG.md +30 -0
- package/CONTRIBUTING.md +1 -1
- package/README.md +1 -1
- package/bin/lessc +23 -8
- package/dist/less-1.4.0-beta.js +18 -18
- package/dist/less-1.4.0-beta.min.js +11 -4
- package/dist/less-1.4.0.js +5830 -0
- package/dist/less-1.4.0.min.js +11 -0
- package/dist/less-1.4.1.js +5837 -0
- package/dist/less-1.4.1.min.js +11 -0
- package/dist/less-1.4.2.js +5837 -0
- package/dist/less-1.4.2.min.js +11 -0
- package/lib/less/browser.js +3 -3
- package/lib/less/env.js +10 -6
- package/lib/less/extend-visitor.js +4 -3
- package/lib/less/index.js +1 -1
- package/lib/less/lessc_helper.js +6 -7
- package/lib/less/parser.js +6 -5
- package/lib/less/rhino.js +2 -1
- package/lib/less/tree/expression.js +1 -1
- package/lib/less/tree/extend.js +2 -1
- package/lib/less/tree/media.js +6 -6
- package/lib/less/tree/negative.js +1 -1
- package/lib/less/tree/operation.js +1 -1
- package/lib/less/tree/rule.js +6 -6
- package/package.json +5 -5
- package/test/browser/common.js +1 -1
- package/test/browser/phantom-runner.js +1 -1
- package/test/browser/runner-legacy.js +1 -1
- package/test/css/css-3.css +3 -0
- package/test/css/legacy/legacy.css +1 -1
- package/test/less/css-3.less +4 -1
- package/test/less/legacy/legacy.less +1 -1
- package/test/less-test.js +36 -8
- package/.gitattributes +0 -9
package/test/less-test.js
CHANGED
|
@@ -5,6 +5,8 @@ var path = require('path'),
|
|
|
5
5
|
var less = require('../lib/less');
|
|
6
6
|
var stylize = require('../lib/less/lessc_helper').stylize;
|
|
7
7
|
|
|
8
|
+
var globals = Object.keys(global);
|
|
9
|
+
|
|
8
10
|
var oneTestOnly = process.argv[2];
|
|
9
11
|
|
|
10
12
|
var totalTests = 0,
|
|
@@ -23,9 +25,9 @@ less.tree.functions._color = function (str) {
|
|
|
23
25
|
|
|
24
26
|
sys.puts("\n" + stylize("LESS", 'underline') + "\n");
|
|
25
27
|
|
|
26
|
-
runTestSet({relativeUrls: true, silent: true});
|
|
28
|
+
runTestSet({strictMath: true, relativeUrls: true, silent: true});
|
|
27
29
|
|
|
28
|
-
runTestSet({strictUnits: true}, "errors/", function(name, err, compiledLess, doReplacements) {
|
|
30
|
+
runTestSet({strictMath: true, strictUnits: true}, "errors/", function(name, err, compiledLess, doReplacements) {
|
|
29
31
|
fs.readFile(path.join('test/less/', name) + '.txt', 'utf8', function (e, expectedErr) {
|
|
30
32
|
sys.print("- " + name + ": ");
|
|
31
33
|
expectedErr = doReplacements(expectedErr, 'test/less/errors/');
|
|
@@ -53,15 +55,16 @@ runTestSet({strictUnits: true}, "errors/", function(name, err, compiledLess, doR
|
|
|
53
55
|
.replace(/\r\n/g, '\n');
|
|
54
56
|
});
|
|
55
57
|
|
|
56
|
-
runTestSet({dumpLineNumbers: 'comments'}, "debug/", null,
|
|
58
|
+
runTestSet({strictMath: true, dumpLineNumbers: 'comments'}, "debug/", null,
|
|
57
59
|
function(name) { return name + '-comments'; });
|
|
58
|
-
runTestSet({dumpLineNumbers: 'mediaquery'}, "debug/", null,
|
|
60
|
+
runTestSet({strictMath: true, dumpLineNumbers: 'mediaquery'}, "debug/", null,
|
|
59
61
|
function(name) { return name + '-mediaquery'; });
|
|
60
|
-
runTestSet({dumpLineNumbers: 'all'}, "debug/", null,
|
|
62
|
+
runTestSet({strictMath: true, dumpLineNumbers: 'all'}, "debug/", null,
|
|
61
63
|
function(name) { return name + '-all'; });
|
|
62
|
-
runTestSet({relativeUrls: false, rootpath: "folder (1)/"}, "static-urls/");
|
|
63
|
-
runTestSet({compress: true}, "compression/");
|
|
64
|
-
runTestSet({
|
|
64
|
+
runTestSet({strictMath: true, relativeUrls: false, rootpath: "folder (1)/"}, "static-urls/");
|
|
65
|
+
runTestSet({strictMath: true, compress: true}, "compression/");
|
|
66
|
+
runTestSet({ }, "legacy/");
|
|
67
|
+
testNoOptions();
|
|
65
68
|
|
|
66
69
|
function globalReplacements(input, directory) {
|
|
67
70
|
var p = path.join(process.cwd(), directory),
|
|
@@ -76,6 +79,12 @@ function globalReplacements(input, directory) {
|
|
|
76
79
|
.replace(/\r\n/g, '\n');
|
|
77
80
|
}
|
|
78
81
|
|
|
82
|
+
function checkGlobalLeaks() {
|
|
83
|
+
return Object.keys(global).filter(function(v) {
|
|
84
|
+
return globals.indexOf(v) < 0;
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
|
|
79
88
|
function runTestSet(options, foldername, verifyFunction, nameModifier, doReplacements) {
|
|
80
89
|
foldername = foldername || "";
|
|
81
90
|
|
|
@@ -146,6 +155,7 @@ function ok(msg) {
|
|
|
146
155
|
}
|
|
147
156
|
|
|
148
157
|
function endTest() {
|
|
158
|
+
var leaked = checkGlobalLeaks();
|
|
149
159
|
if (failedTests + passedTests === totalTests) {
|
|
150
160
|
sys.puts("");
|
|
151
161
|
sys.puts("");
|
|
@@ -157,6 +167,12 @@ function endTest() {
|
|
|
157
167
|
sys.print(stylize("All Passed ", "green"));
|
|
158
168
|
sys.print(passedTests + " run");
|
|
159
169
|
}
|
|
170
|
+
if (leaked.length > 0) {
|
|
171
|
+
sys.puts("");
|
|
172
|
+
sys.puts("");
|
|
173
|
+
sys.print(stylize("Global leak detected: ", "red") + leaked.join(', '));
|
|
174
|
+
sys.print("\n");
|
|
175
|
+
}
|
|
160
176
|
}
|
|
161
177
|
}
|
|
162
178
|
|
|
@@ -184,3 +200,15 @@ function toCSS(options, path, callback) {
|
|
|
184
200
|
});
|
|
185
201
|
});
|
|
186
202
|
}
|
|
203
|
+
|
|
204
|
+
function testNoOptions() {
|
|
205
|
+
totalTests++;
|
|
206
|
+
try {
|
|
207
|
+
sys.print("- Integration - creating parser without options: ");
|
|
208
|
+
new(less.Parser);
|
|
209
|
+
} catch(e) {
|
|
210
|
+
fail(stylize("FAIL\n", "red"));
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
ok(stylize("OK\n", "green"));
|
|
214
|
+
}
|