Socket
Socket
Sign inDemoInstall

less

Package Overview
Dependencies
Maintainers
5
Versions
130
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

less - npm Package Compare versions

Comparing version 3.0.4 to 3.5.0-beta

test/css/permissive-parse.css

4

.eslintrc.json

@@ -7,2 +7,6 @@ {

"rules": {
"quotes": [
1,
"single"
],
"no-eval": 2,

@@ -9,0 +13,0 @@ "no-use-before-define": [

@@ -0,5 +1,9 @@

## 3.0.4
2018-05-06
- Update source-map to 0.6.x (#3180). Enforces node 6+ though.
# 3.0.0
2018-02-10
- Fix `calc()` function to not do math operations on compile
- Rename Directive -> AtRule & Rule -> Declaration
- Rename Directive -> AtRule & Rule -> Declaration
- Cross-platform `@plugin` loading! (Node & Browser)

@@ -6,0 +10,0 @@ - Numerous changes / improvements to plugin architecture

8

CONTRIBUTING.md

@@ -18,5 +18,5 @@ # Contributing to Less.js

3. **Test with the latest version**. We get a lot of issues that could be resolved by updating your version of Less.js.
3. **Include an example with source.** E.g. You can use [less2css.org](http://less2css.org/) to create a short test case.
4. **Share as much information as possible.** Include operating system and version. Describe how you use Less. If you use it in the browser, please include browser and version, and the version of Less.js you're using. Let us know if you're using the command line (`lessc`) or an external tool. And try to include steps to reproduce the bug.
5. If you have a solution or suggestion for how to fix the bug you're reporting, please include it, or make a pull request - don't assume the maintainers know how to fix it just because you do.
4. **Include an example with source.** E.g. You can use [Less Preview](http://lesscss.org/less-preview/) to create a short test case.
5. **Share as much information as possible.** Include operating system and version. Describe how you use Less. If you use it in the browser, please include browser and version, and the version of Less.js you're using. Let us know if you're using the command line (`lessc`) or an external tool. And try to include steps to reproduce the bug.
6. If you have a solution or suggestion for how to fix the bug you're reporting, please include it, or make a pull request - don't assume the maintainers know how to fix it just because you do.

@@ -39,3 +39,3 @@ Please report documentation issues in [the documentation project](https://github.com/less/less-docs).

* Do not change the **./dist/** folder, we do this when releasing
* _Please add tests_ for your work. Tests are invoked using `grunt test` command. It will run both node.js tests and browser ([PhantomJS](http://phantomjs.org/)) tests.
* _Please add tests_ for your work. Tests are invoked using `npm test` command. It will run both node.js tests and browser ([PhantomJS](http://phantomjs.org/)) tests.

@@ -42,0 +42,0 @@ ### Coding Standards

@@ -18,3 +18,3 @@ 'use strict';

{
browserName: "chrome",
browserName: 'chrome',
version: 'latest',

@@ -24,3 +24,3 @@ platform: 'Windows 7'

{
browserName: "firefox",
browserName: 'firefox',
version: 'latest',

@@ -35,3 +35,3 @@ platform: 'Linux'

{
browserName: "internet explorer",
browserName: 'internet explorer',
version: '8',

@@ -41,3 +41,3 @@ platform: 'Windows XP'

{
browserName: "internet explorer",
browserName: 'internet explorer',
version: '11',

@@ -47,3 +47,3 @@ platform: 'Windows 8.1'

{
browserName: "edge",
browserName: 'edge',
version: '13',

@@ -78,13 +78,13 @@ platform: 'Windows 10'

var browserTests = [ "filemanager-plugin",
"visitor-plugin",
"global-vars",
"modify-vars",
"production",
"rootpath-relative",
"rootpath",
"relative-urls",
"browser",
"no-js-errors",
"legacy"
var browserTests = [ 'filemanager-plugin',
'visitor-plugin',
'global-vars',
'modify-vars',
'production',
'rootpath-relative',
'rootpath',
'relative-urls',
'browser',
'no-js-errors',
'legacy'
];

@@ -97,5 +97,5 @@

browserTests.map(function(name) {
return "http://localhost:8081/tmp/browser/test-runner-" + name + ".html";
return 'http://localhost:8081/tmp/browser/test-runner-' + name + '.html';
}) :
["http://localhost:8081/tmp/browser/test-runner-" + testName + ".html"],
['http://localhost:8081/tmp/browser/test-runner-' + testName + '.html'],
testname: testName === 'all' ? 'Unit Tests for Less.js' : testName,

@@ -106,4 +106,4 @@ browsers: browsers,

videoUploadOnPass: false,
recordScreenshots: process.env.TRAVIS_BRANCH !== "master",
build: process.env.TRAVIS_BRANCH === "master" ? process.env.TRAVIS_JOB_ID : undefined,
recordScreenshots: process.env.TRAVIS_BRANCH !== 'master',
build: process.env.TRAVIS_BRANCH === 'master' ? process.env.TRAVIS_JOB_ID : undefined,
tags: [process.env.TRAVIS_BUILD_NUMBER, process.env.TRAVIS_PULL_REQUEST, process.env.TRAVIS_BRANCH],

@@ -204,3 +204,3 @@ statusCheckAttempts: -1,

},
"sourcemap-test": {
'sourcemap-test': {
command: [

@@ -217,3 +217,3 @@ 'node bin/lessc --source-map=test/sourcemaps/maps/import-map.map test/less/import.less test/sourcemaps/import.css',

options: {
exclude: ["promise"],
exclude: ['promise'],
browserifyOptions: {

@@ -278,11 +278,11 @@ standalone: 'less'

eslint: {
target: ["Gruntfile.js",
"test/**/*.js",
"lib/less*/**/*.js",
"bin/lessc",
"!test/browser/jasmine-jsreporter.js",
"!test/less/errors/plugin/plugin-error.js"
target: ['Gruntfile.js',
'test/**/*.js',
'lib/less*/**/*.js',
'bin/lessc',
'!test/browser/jasmine-jsreporter.js',
'!test/less/errors/plugin/plugin-error.js'
],
options: {
configFile: ".eslintrc.json"
configFile: '.eslintrc.json'
}

@@ -452,4 +452,4 @@ },

test: ['test/browser/less.js', 'tmp', 'test/less-bom'],
"sourcemap-test": ['test/sourcemaps/*.css', 'test/sourcemaps/*.map'],
sauce_log: ["sc_*.log"]
'sourcemap-test': ['test/sourcemaps/*.css', 'test/sourcemaps/*.map'],
sauce_log: ['sc_*.log']
}

@@ -506,13 +506,13 @@ });

var previous_force_state = grunt.option("force");
var previous_force_state = grunt.option('force');
grunt.registerTask("force",function(set) {
if (set === "on") {
grunt.option("force",true);
grunt.registerTask('force',function(set) {
if (set === 'on') {
grunt.option('force',true);
}
else if (set === "off") {
grunt.option("force",false);
else if (set === 'off') {
grunt.option('force',false);
}
else if (set === "restore") {
grunt.option("force",previous_force_state);
else if (set === 'restore') {
grunt.option('force',previous_force_state);
}

@@ -543,6 +543,6 @@ });

Number(process.env.TRAVIS_NODE_VERSION) === 4 &&
(process.env.TRAVIS_BRANCH === "master" || process.env.TRAVIS_BRANCH === "3.x")) {
testTasks.push("force:on");
testTasks.push("sauce-after-setup");
testTasks.push("force:off");
(process.env.TRAVIS_BRANCH === 'master' || process.env.TRAVIS_BRANCH === '3.x')) {
testTasks.push('force:on');
testTasks.push('sauce-after-setup');
testTasks.push('force:off');
}

@@ -549,0 +549,0 @@

@@ -1,3 +0,3 @@

var addDataAttr = require("./utils").addDataAttr,
browser = require("./browser");
var addDataAttr = require('./utils').addDataAttr,
browser = require('./browser');

@@ -46,4 +46,5 @@ module.exports = function(window, options) {

// TODO: deprecate and remove 'inlineJavaScript' thing - where it came from at all?
options.javascriptEnabled = (options.javascriptEnabled || options.inlineJavaScript) ? true : false;
};

@@ -11,3 +11,3 @@ /**

// Browsers have good Promise support
require("promise/polyfill");
require('promise/polyfill');

@@ -23,3 +23,3 @@ var options = require('../less/default-options')();

}
require("./add-default-options")(window, options);
require('./add-default-options')(window, options);

@@ -32,3 +32,3 @@ options.plugins = options.plugins || [];

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

@@ -35,0 +35,0 @@ window.less = less;

@@ -1,2 +0,2 @@

var utils = require("./utils");
var utils = require('./utils');
module.exports = {

@@ -53,3 +53,3 @@ createCSS: function (document, styles, sheet) {

} catch (e) {
throw new Error("Couldn't reassign styleSheet.cssText.");
throw new Error('Couldn\'t reassign styleSheet.cssText.');
}

@@ -61,3 +61,3 @@ }

return document.currentScript || (function() {
var scripts = document.getElementsByTagName("script");
var scripts = document.getElementsByTagName('script');
return scripts[scripts.length - 1];

@@ -64,0 +64,0 @@ })();

@@ -1,3 +0,3 @@

var utils = require("./utils"),
browser = require("./browser");
var utils = require('./utils'),
browser = require('./browser');

@@ -7,3 +7,3 @@ module.exports = function(window, less, options) {

function errorHTML(e, rootHref) {
var id = 'less-error-message:' + utils.extractId(rootHref || "");
var id = 'less-error-message:' + utils.extractId(rootHref || '');
var template = '<li><label>{line}</label><pre class="{class}">{content}</pre></li>';

@@ -15,6 +15,6 @@ var elem = window.document.createElement('div'), timer, content, errors = [];

elem.id = id;
elem.className = "less-error-message";
elem.className = 'less-error-message';
content = '<h3>' + (e.type || "Syntax") + "Error: " + (e.message || 'There is an error in your .less file') +
'</h3>' + '<p>in <a href="' + filename + '">' + filenameNoPath + "</a> ";
content = '<h3>' + (e.type || 'Syntax') + 'Error: ' + (e.message || 'There is an error in your .less file') +
'</h3>' + '<p>in <a href="' + filename + '">' + filenameNoPath + '</a> ';

@@ -82,11 +82,11 @@ var errorline = function (e, i, classname) {

elem.style.cssText = [
"font-family: Arial, sans-serif",
"border: 1px solid #e00",
"background-color: #eee",
"border-radius: 5px",
"-webkit-border-radius: 5px",
"-moz-border-radius: 5px",
"color: #e00",
"padding: 15px",
"margin-bottom: 15px"
'font-family: Arial, sans-serif',
'border: 1px solid #e00',
'background-color: #eee',
'border-radius: 5px',
'-webkit-border-radius: 5px',
'-moz-border-radius: 5px',
'color: #e00',
'padding: 15px',
'margin-bottom: 15px'
].join(';');

@@ -122,8 +122,8 @@

function removeError(path) {
if (!options.errorReporting || options.errorReporting === "html") {
if (!options.errorReporting || options.errorReporting === 'html') {
removeErrorHTML(path);
} else if (options.errorReporting === "console") {
} else if (options.errorReporting === 'console') {
removeErrorConsole(path);
} else if (typeof options.errorReporting === 'function') {
options.errorReporting("remove", path);
options.errorReporting('remove', path);
}

@@ -136,4 +136,4 @@ }

var errors = [];
var content = (e.type || "Syntax") + "Error: " + (e.message || 'There is an error in your .less file') +
" in " + filename;
var content = (e.type || 'Syntax') + 'Error: ' + (e.message || 'There is an error in your .less file') +
' in ' + filename;

@@ -162,8 +162,8 @@ var errorline = function (e, i, classname) {

function error(e, rootHref) {
if (!options.errorReporting || options.errorReporting === "html") {
if (!options.errorReporting || options.errorReporting === 'html') {
errorHTML(e, rootHref);
} else if (options.errorReporting === "console") {
} else if (options.errorReporting === 'console') {
errorConsole(e, rootHref);
} else if (typeof options.errorReporting === 'function') {
options.errorReporting("add", e, rootHref);
options.errorReporting('add', e, rootHref);
}

@@ -170,0 +170,0 @@ }

@@ -5,3 +5,3 @@ /* global window, XMLHttpRequest */

var AbstractFileManager = require("../less/environment/abstract-file-manager.js");
var AbstractFileManager = require('../less/environment/abstract-file-manager.js');

@@ -33,3 +33,3 @@ var fileCache = {};

}
logger.debug("XHR: Getting '" + url + "'");
logger.debug('XHR: Getting \'' + url + '\'');
xhr.open('GET', url, async);

@@ -42,3 +42,3 @@ xhr.setRequestHeader('Accept', type || 'text/x-less, text/css; q=0.9, */*; q=0.5');

callback(xhr.responseText,
xhr.getResponseHeader("Last-Modified"));
xhr.getResponseHeader('Last-Modified'));
} else if (typeof errback === 'function') {

@@ -97,3 +97,3 @@ errback(xhr.status, url);

} catch (e) {
return reject({ filename: href, message: "Error loading file " + href + " error was " + e.message });
return reject({ filename: href, message: 'Error loading file ' + href + ' error was ' + e.message });
}

@@ -109,3 +109,3 @@ }

}, function doXHRError(status, url) {
reject({ type: 'File', message: "'" + url + "' wasn't found (" + status + ")", href: href });
reject({ type: 'File', message: '\'' + url + '\' wasn\'t found (' + status + ')', href: href });
});

@@ -112,0 +112,0 @@ });

module.exports = function() {
var functionRegistry = require("./../less/functions/function-registry");
var functionRegistry = require('./../less/functions/function-registry');
function imageSize() {
throw {
type: "Runtime",
message: "Image size functions are not supported in browser version of less"
type: 'Runtime',
message: 'Image size functions are not supported in browser version of less'
};

@@ -13,11 +13,11 @@ }

var imageFunctions = {
"image-size": function(filePathNode) {
'image-size': function(filePathNode) {
imageSize(this, filePathNode);
return -1;
},
"image-width": function(filePathNode) {
'image-width': function(filePathNode) {
imageSize(this, filePathNode);
return -1;
},
"image-height": function(filePathNode) {
'image-height': function(filePathNode) {
imageSize(this, filePathNode);

@@ -24,0 +24,0 @@ return -1;

@@ -5,4 +5,4 @@ //

//
var addDataAttr = require("./utils").addDataAttr,
browser = require("./browser");
var addDataAttr = require('./utils').addDataAttr,
browser = require('./browser');

@@ -15,11 +15,11 @@ module.exports = function(window, options) {

var environment = less.environment,
FileManager = require("./file-manager")(options, less.logger),
FileManager = require('./file-manager')(options, less.logger),
fileManager = new FileManager();
environment.addFileManager(fileManager);
less.FileManager = FileManager;
less.PluginLoader = require("./plugin-loader");
less.PluginLoader = require('./plugin-loader');
require("./log-listener")(less, options);
var errors = require("./error-reporting")(window, less, options);
var cache = less.cache = options.cache || require("./cache")(window, options, less.logger);
require('./log-listener')(less, options);
var errors = require('./error-reporting')(window, less, options);
var cache = less.cache = options.cache || require('./cache')(window, options, less.logger);
require('./image-size')(less.environment);

@@ -64,3 +64,3 @@

if (e) {
errors.add(e, "inline");
errors.add(e, 'inline');
} else {

@@ -228,3 +228,3 @@ style.type = 'text/css';

totalMilliseconds = endTime - startTime;
less.logger.info("Less has finished and no sheets were loaded.");
less.logger.info('Less has finished and no sheets were loaded.');
resolve({

@@ -246,8 +246,8 @@ startTime: startTime,

if (webInfo.local) {
less.logger.info("Loading " + sheet.href + " from cache.");
less.logger.info('Loading ' + sheet.href + ' from cache.');
} else {
less.logger.info("Rendered " + sheet.href + " successfully.");
less.logger.info('Rendered ' + sheet.href + ' successfully.');
}
browser.createCSS(window.document, css, sheet);
less.logger.info("CSS for " + sheet.href + " generated in " + (new Date() - endTime) + 'ms');
less.logger.info('CSS for ' + sheet.href + ' generated in ' + (new Date() - endTime) + 'ms');

@@ -260,3 +260,3 @@ // Count completed sheet

totalMilliseconds = new Date() - startTime;
less.logger.info("Less has finished. CSS generated in " + totalMilliseconds + 'ms');
less.logger.info('Less has finished. CSS generated in ' + totalMilliseconds + 'ms');
resolve({

@@ -263,0 +263,0 @@ startTime: startTime,

// TODO: Add tests for browser @plugin
/*global window */
/* global window */
var AbstractPluginLoader = require("../less/environment/abstract-plugin-loader.js");
var AbstractPluginLoader = require('../less/environment/abstract-plugin-loader.js');

@@ -6,0 +6,0 @@ /**

@@ -13,3 +13,3 @@ module.exports = {

if (tag.dataset.hasOwnProperty(opt)) {
if (opt === "env" || opt === "dumpLineNumbers" || opt === "rootpath" || opt === "errorReporting") {
if (opt === 'env' || opt === 'dumpLineNumbers' || opt === 'rootpath' || opt === 'errorReporting') {
options[opt] = tag.dataset[opt];

@@ -16,0 +16,0 @@ } else {

@@ -12,4 +12,4 @@ module.exports = {

getSourceMapGenerator: function getSourceMapGenerator() {
return require("source-map").SourceMapGenerator;
return require('source-map').SourceMapGenerator;
}
};
var path = require('path'),
fs = require('./fs'),
PromiseConstructor = typeof Promise === 'undefined' ? require('promise') : Promise,
AbstractFileManager = require("../less/environment/abstract-file-manager.js");
AbstractFileManager = require('../less/environment/abstract-file-manager.js');

@@ -26,3 +26,3 @@ var FileManager = function() {

prefix = filename.slice(0, 1),
explicit = prefix === "." || prefix === "/",
explicit = prefix === '.' || prefix === '/',
result = null,

@@ -112,6 +112,19 @@ isNodeModule = false,

var modified = false;
if (self.contents[fullFilename]) {
fulfill({ contents: self.contents[fullFilename], filename: fullFilename});
try {
var stat = fs.statSync.apply(this, [fullFilename]);
if (stat.mtime.getTime() === self.contents[fullFilename].mtime.getTime()) {
fulfill({ contents: self.contents[fullFilename].data, filename: fullFilename});
}
else {
modified = true;
}
}
catch (e) {
modified = true;
}
}
else {
if (modified || !self.contents[fullFilename]) {
var readFileArgs = [fullFilename];

@@ -124,3 +137,4 @@ if (!options.rawBuffer) {

var data = fs.readFileSync.apply(this, readFileArgs);
self.contents[fullFilename] = data;
var stat = fs.statSync.apply(this, [fullFilename]);
self.contents[fullFilename] = { data: data, mtime: stat.mtime };
fulfill({ contents: data, filename: fullFilename});

@@ -139,3 +153,4 @@ }

}
self.contents[fullFilename] = data;
var stat = fs.statSync.apply(this, [fullFilename]);
self.contents[fullFilename] = { data: data, mtime: stat.mtime };
fulfill({ contents: data, filename: fullFilename});

@@ -154,3 +169,3 @@ });

} else {
reject({ type: 'File', message: "'" + filename + "' wasn't found. Tried - " + filenamesTried.join(",") });
reject({ type: 'File', message: '\'' + filename + '\' wasn\'t found. Tried - ' + filenamesTried.join(',') });
}

@@ -157,0 +172,0 @@ }(0));

var fs;
try
{
fs = require("graceful-fs");
fs = require('graceful-fs');
}
catch (e)
{
fs = require("fs");
fs = require('fs');
}
module.exports = fs;
module.exports = function(environment) {
var Dimension = require("../less/tree/dimension"),
Expression = require("../less/tree/expression"),
functionRegistry = require("./../less/functions/function-registry");
var Dimension = require('../less/tree/dimension'),
Expression = require('../less/tree/expression'),
functionRegistry = require('./../less/functions/function-registry');

@@ -23,4 +23,4 @@ function imageSize(functionContext, filePathNode) {

throw {
type: "File",
message: "Can not set up FileManager for " + filePathNode
type: 'File',
message: 'Can not set up FileManager for ' + filePathNode
};

@@ -40,16 +40,16 @@ }

var imageFunctions = {
"image-size": function(filePathNode) {
'image-size': function(filePathNode) {
var size = imageSize(this, filePathNode);
return new Expression([
new Dimension(size.width, "px"),
new Dimension(size.height, "px")
new Dimension(size.width, 'px'),
new Dimension(size.height, 'px')
]);
},
"image-width": function(filePathNode) {
'image-width': function(filePathNode) {
var size = imageSize(this, filePathNode);
return new Dimension(size.width, "px");
return new Dimension(size.width, 'px');
},
"image-height": function(filePathNode) {
'image-height': function(filePathNode) {
var size = imageSize(this, filePathNode);
return new Dimension(size.height, "px");
return new Dimension(size.height, 'px');
}

@@ -56,0 +56,0 @@ };

@@ -1,5 +0,5 @@

var environment = require("./environment"),
FileManager = require("./file-manager"),
UrlFileManager = require("./url-file-manager"),
createFromEnvironment = require("../less"),
var environment = require('./environment'),
FileManager = require('./file-manager'),
UrlFileManager = require('./url-file-manager'),
createFromEnvironment = require('../less'),
less = createFromEnvironment(environment, [new FileManager(), new UrlFileManager()]),

@@ -12,4 +12,4 @@ lesscHelper = require('./lessc-helper'),

less.lesscHelper = lesscHelper;
less.PluginLoader = require("./plugin-loader");
less.fs = require("./fs");
less.PluginLoader = require('./plugin-loader');
less.fs = require('./fs');
less.FileManager = FileManager;

@@ -16,0 +16,0 @@ less.UrlFileManager = UrlFileManager;

@@ -24,56 +24,56 @@ // lessc_helper.js

printUsage: function() {
console.log("usage: lessc [option option=parameter ...] <source> [destination]");
console.log("");
console.log("If source is set to `-' (dash or hyphen-minus), input is read from stdin.");
console.log("");
console.log("options:");
console.log(" -h, --help Prints help (this message) and exit.");
console.log(" --include-path=PATHS Sets include paths. Separated by `:'. `;' also supported on windows.");
console.log(" -M, --depends Outputs a makefile import dependency list to stdout.");
console.log(" --no-color Disables colorized output.");
console.log(" --ie-compat Enables IE8 compatibility checks.");
console.log(" --js Enables inline JavaScript in less files");
console.log(" -l, --lint Syntax check only (lint).");
console.log(" -s, --silent Suppresses output of error messages.");
console.log(" --strict-imports Forces evaluation of imports.");
console.log(" --insecure Allows imports from insecure https hosts.");
console.log(" -v, --version Prints version number and exit.");
console.log(" --verbose Be verbose.");
console.log(" --source-map[=FILENAME] Outputs a v3 sourcemap to the filename (or output filename.map).");
console.log(" --source-map-rootpath=X Adds this path onto the sourcemap filename and less file paths.");
console.log(" --source-map-basepath=X Sets sourcemap base path, defaults to current working directory.");
console.log(" --source-map-include-source Puts the less files into the map instead of referencing them.");
console.log(" --source-map-inline Puts the map (and any less files) as a base64 data uri into the output css file.");
console.log(" --source-map-url=URL Sets a custom URL to map file, for sourceMappingURL comment");
console.log(" in generated CSS file.");
console.log(" -rp, --rootpath=URL Sets rootpath for url rewriting in relative imports and urls");
console.log(" Works with or without the relative-urls option.");
console.log(" -ru, --relative-urls Re-writes relative urls to the base less file.");
console.log(" -sm=on|off Turns on or off strict math, where in strict mode, math.");
console.log(" --strict-math=on|off Requires brackets. This option may default to on and then");
console.log(" be removed in the future.");
console.log(" -su=on|off Allows mixed units, e.g. 1px+1em or 1px*1px which have units");
console.log(" --strict-units=on|off that cannot be represented.");
console.log(" --global-var='VAR=VALUE' Defines a variable that can be referenced by the file.");
console.log(" --modify-var='VAR=VALUE' Modifies a variable already declared in the file.");
console.log(" --url-args='QUERYSTRING' Adds params into url tokens (e.g. 42, cb=42 or 'a=1&b=2')");
console.log(" --plugin=PLUGIN=OPTIONS Loads a plugin. You can also omit the --plugin= if the plugin begins");
console.log(" less-plugin. E.g. the clean css plugin is called less-plugin-clean-css");
console.log(" once installed (npm install less-plugin-clean-css), use either with");
console.log(" --plugin=less-plugin-clean-css or just --clean-css");
console.log(" specify options afterwards e.g. --plugin=less-plugin-clean-css=\"advanced\"");
console.log(" or --clean-css=\"advanced\"");
console.log("");
console.log("-------------------------- Deprecated ----------------");
console.log(" --line-numbers=TYPE Outputs filename and line numbers.");
console.log(" TYPE can be either 'comments', which will output");
console.log(" the debug info within comments, 'mediaquery'");
console.log(" that will output the information within a fake");
console.log(" media query which is compatible with the SASS");
console.log(" format, and 'all' which will do both.");
console.log(" -x, --compress Compresses output by removing some whitespaces.");
console.log(" We recommend you use a dedicated minifer like less-plugin-clean-css");
console.log("");
console.log("Report bugs to: http://github.com/less/less.js/issues");
console.log("Home page: <http://lesscss.org/>");
console.log('usage: lessc [option option=parameter ...] <source> [destination]');
console.log('');
console.log('If source is set to `-\' (dash or hyphen-minus), input is read from stdin.');
console.log('');
console.log('options:');
console.log(' -h, --help Prints help (this message) and exit.');
console.log(' --include-path=PATHS Sets include paths. Separated by `:\'. `;\' also supported on windows.');
console.log(' -M, --depends Outputs a makefile import dependency list to stdout.');
console.log(' --no-color Disables colorized output.');
console.log(' --ie-compat Enables IE8 compatibility checks.');
console.log(' --js Enables inline JavaScript in less files');
console.log(' -l, --lint Syntax check only (lint).');
console.log(' -s, --silent Suppresses output of error messages.');
console.log(' --strict-imports Forces evaluation of imports.');
console.log(' --insecure Allows imports from insecure https hosts.');
console.log(' -v, --version Prints version number and exit.');
console.log(' --verbose Be verbose.');
console.log(' --source-map[=FILENAME] Outputs a v3 sourcemap to the filename (or output filename.map).');
console.log(' --source-map-rootpath=X Adds this path onto the sourcemap filename and less file paths.');
console.log(' --source-map-basepath=X Sets sourcemap base path, defaults to current working directory.');
console.log(' --source-map-include-source Puts the less files into the map instead of referencing them.');
console.log(' --source-map-inline Puts the map (and any less files) as a base64 data uri into the output css file.');
console.log(' --source-map-url=URL Sets a custom URL to map file, for sourceMappingURL comment');
console.log(' in generated CSS file.');
console.log(' -rp, --rootpath=URL Sets rootpath for url rewriting in relative imports and urls');
console.log(' Works with or without the relative-urls option.');
console.log(' -ru, --relative-urls Re-writes relative urls to the base less file.');
console.log(' -sm=on|off Turns on or off strict math, where in strict mode, math.');
console.log(' --strict-math=on|off Requires brackets. This option may default to on and then');
console.log(' be removed in the future.');
console.log(' -su=on|off Allows mixed units, e.g. 1px+1em or 1px*1px which have units');
console.log(' --strict-units=on|off that cannot be represented.');
console.log(' --global-var=\'VAR=VALUE\' Defines a variable that can be referenced by the file.');
console.log(' --modify-var=\'VAR=VALUE\' Modifies a variable already declared in the file.');
console.log(' --url-args=\'QUERYSTRING\' Adds params into url tokens (e.g. 42, cb=42 or \'a=1&b=2\')');
console.log(' --plugin=PLUGIN=OPTIONS Loads a plugin. You can also omit the --plugin= if the plugin begins');
console.log(' less-plugin. E.g. the clean css plugin is called less-plugin-clean-css');
console.log(' once installed (npm install less-plugin-clean-css), use either with');
console.log(' --plugin=less-plugin-clean-css or just --clean-css');
console.log(' specify options afterwards e.g. --plugin=less-plugin-clean-css="advanced"');
console.log(' or --clean-css="advanced"');
console.log('');
console.log('-------------------------- Deprecated ----------------');
console.log(' --line-numbers=TYPE Outputs filename and line numbers.');
console.log(' TYPE can be either \'comments\', which will output');
console.log(' the debug info within comments, \'mediaquery\'');
console.log(' that will output the information within a fake');
console.log(' media query which is compatible with the SASS');
console.log(' format, and \'all\' which will do both.');
console.log(' -x, --compress Compresses output by removing some whitespaces.');
console.log(' We recommend you use a dedicated minifer like less-plugin-clean-css');
console.log('');
console.log('Report bugs to: http://github.com/less/less.js/issues');
console.log('Home page: <http://lesscss.org/>');
}

@@ -80,0 +80,0 @@ };

@@ -1,4 +0,4 @@

var path = require("path"),
var path = require('path'),
PromiseConstructor = typeof Promise === 'undefined' ? require('promise') : Promise,
AbstractPluginLoader = require("../less/environment/abstract-plugin-loader.js");
AbstractPluginLoader = require('../less/environment/abstract-plugin-loader.js');

@@ -30,3 +30,3 @@ /**

var prefix = filename.slice(0, 1);
var explicit = prefix === "." || prefix === "/" || filename.slice(-3).toLowerCase() === ".js";
var explicit = prefix === '.' || prefix === '/' || filename.slice(-3).toLowerCase() === '.js';
if (!explicit) {

@@ -33,0 +33,0 @@ context.prefixes = ['less-plugin-', ''];

@@ -5,4 +5,4 @@ var isUrlRe = /^(?:https?:)?\/\//i,

PromiseConstructor,
AbstractFileManager = require("../less/environment/abstract-file-manager.js"),
logger = require("../less/logger");
AbstractFileManager = require('../less/environment/abstract-file-manager.js'),
logger = require('../less/logger');

@@ -28,3 +28,3 @@ var UrlFileManager = function() {

if (!request) {
reject({ type: 'File', message: "optional dependency 'request' required to import over http(s)\n" });
reject({ type: 'File', message: 'optional dependency \'request\' required to import over http(s)\n' });
return;

@@ -37,3 +37,3 @@ }

if (!urlObj.protocol) {
urlObj.protocol = "http";
urlObj.protocol = 'http';
urlStr = urlObj.format();

@@ -44,7 +44,7 @@ }

if (error) {
reject({ type: 'File', message: "resource '" + urlStr + "' gave this Error:\n " + error + "\n" });
reject({ type: 'File', message: 'resource \'' + urlStr + '\' gave this Error:\n ' + error + '\n' });
return;
}
if (res && res.statusCode === 404) {
reject({ type: 'File', message: "resource '" + urlStr + "' was not found\n" });
reject({ type: 'File', message: 'resource \'' + urlStr + '\' was not found\n' });
return;

@@ -51,0 +51,0 @@ }

@@ -7,3 +7,3 @@ /* jshint rhino:true, unused: false */

var message = "";
var message = '';
var extract = ctx.extract;

@@ -128,3 +128,3 @@ var error = [];

} catch (e) {
callback({ type: 'File', message: "'" + less.modules.path.basename(href) + "' wasn't found" });
callback({ type: 'File', message: '\'' + less.modules.path.basename(href) + '\' wasn\'t found' });
return;

@@ -157,3 +157,3 @@ }

if (!option) {
print(arg + " option requires a parameter");
print(arg + ' option requires a parameter');
continueProcessing = false;

@@ -168,3 +168,3 @@ return false;

if (!onOff) {
print(" unable to parse " + arg + " as a boolean. use one of on/t/true/y/yes/off/f/false/n/no");
print(' unable to parse ' + arg + ' as a boolean. use one of on/t/true/y/yes/off/f/false/n/no');
continueProcessing = false;

@@ -176,3 +176,3 @@ return false;

var warningMessages = "";
var warningMessages = '';
var sourceMapFileInline = false;

@@ -199,3 +199,3 @@

case 'version':
console.log("lessc " + less.version.join('.') + " (Less Compiler) [JavaScript]");
console.log('lessc ' + less.version.join('.') + ' (Less Compiler) [JavaScript]');
continueProcessing = false;

@@ -232,3 +232,3 @@ break;

case 'yui-compress':
warningMessages += "yui-compress option has been removed. assuming clean-css.";
warningMessages += 'yui-compress option has been removed. assuming clean-css.';
options.cleancss = true;

@@ -317,8 +317,8 @@ break;

break;
case "ru":
case "relative-urls":
case 'ru':
case 'relative-urls':
options.relativeUrls = true;
break;
case "sm":
case "strict-math":
case 'sm':
case 'strict-math':
if (checkArgFunc(arg, match[2])) {

@@ -328,4 +328,4 @@ options.strictMath = checkBooleanArg(match[2]);

break;
case "su":
case "strict-units":
case 'su':
case 'strict-units':
if (checkArgFunc(arg, match[2])) {

@@ -363,8 +363,8 @@ options.strictUnits = checkBooleanArg(match[2]);

if (options.sourceMap === true) {
console.log("output: " + output);
console.log('output: ' + output);
if (!output && !sourceMapFileInline) {
console.log("the sourcemap option only has an optional filename if the css filename is given");
console.log('the sourcemap option only has an optional filename if the css filename is given');
return;
}
options.sourceMapFullFilename = options.sourceMapOutputFilename + ".map";
options.sourceMapFullFilename = options.sourceMapOutputFilename + '.map';
options.sourceMap = less.modules.path.basename(options.sourceMapFullFilename);

@@ -376,4 +376,4 @@ } else if (options.sourceMap) {

if (!name) {
console.log("lessc: no inout files");
console.log("");
console.log('lessc: no inout files');
console.log('');
// TODO

@@ -402,6 +402,6 @@ // require('../lib/less/lessc_helper').printUsage();

if (!outputbase) {
console.log("option --depends requires an output path to be specified");
console.log('option --depends requires an output path to be specified');
return;
}
console.log(outputbase + ": ");
console.log(outputbase + ': ');
}

@@ -435,3 +435,3 @@

writeFile(output, result);
console.log("Written to " + output);
console.log('Written to ' + output);
} else {

@@ -438,0 +438,0 @@ print(result);

@@ -39,3 +39,3 @@ var contexts = {};

if (typeof this.paths === "string") { this.paths = [this.paths]; }
if (typeof this.paths === 'string') { this.paths = [this.paths]; }
};

@@ -60,3 +60,3 @@

if (typeof this.paths === "string") { this.paths = [this.paths]; }
if (typeof this.paths === 'string') { this.paths = [this.paths]; }

@@ -92,3 +92,3 @@ this.frames = frames || [];

var
segments = path.split("/").reverse(),
segments = path.split('/').reverse(),
segment;

@@ -100,6 +100,6 @@

switch ( segment ) {
case ".":
case '.':
break;
case "..":
if ((path.length === 0) || (path[path.length - 1] === "..")) {
case '..':
if ((path.length === 0) || (path[path.length - 1] === '..')) {
path.push( segment );

@@ -116,5 +116,5 @@ } else {

return path.join("/");
return path.join('/');
};
// todo - do the same for the toCSS ?
module.exports = {
colors: require("./colors"),
unitConversions: require("./unit-conversions")
colors: require('./colors'),
unitConversions: require('./unit-conversions')
};

@@ -14,3 +14,3 @@ var abstractFileManager = function() {

if (j < 0) {
return "";
return '';
}

@@ -52,5 +52,5 @@ return filename.slice(0, j + 1);

baseUrlParts = this.extractUrlParts(baseUrl),
i, max, urlDirectories, baseUrlDirectories, diff = "";
i, max, urlDirectories, baseUrlDirectories, diff = '';
if (urlParts.hostPart !== baseUrlParts.hostPart) {
return "";
return '';
}

@@ -64,6 +64,6 @@ max = Math.max(baseUrlParts.directories.length, urlParts.directories.length);

for (i = 0; i < baseUrlDirectories.length - 1; i++) {
diff += "../";
diff += '../';
}
for (i = 0; i < urlDirectories.length - 1; i++) {
diff += urlDirectories[i] + "/";
diff += urlDirectories[i] + '/';
}

@@ -85,3 +85,3 @@ return diff;

if (!urlParts) {
throw new Error("Could not parse sheet href - '" + url + "'");
throw new Error('Could not parse sheet href - \'' + url + '\'');
}

@@ -93,5 +93,5 @@

if (!baseUrlParts) {
throw new Error("Could not parse page url - '" + baseUrl + "'");
throw new Error('Could not parse page url - \'' + baseUrl + '\'');
}
urlParts[1] = urlParts[1] || baseUrlParts[1] || "";
urlParts[1] = urlParts[1] || baseUrlParts[1] || '';
if (!urlParts[2]) {

@@ -103,3 +103,3 @@ urlParts[3] = baseUrlParts[3] + urlParts[3];

if (urlParts[3]) {
rawDirectories = urlParts[3].replace(/\\/g, "/").split("/");
rawDirectories = urlParts[3].replace(/\\/g, '/').split('/');

@@ -109,6 +109,6 @@ // collapse '..' and skip '.'

if (rawDirectories[i] === "..") {
if (rawDirectories[i] === '..') {
directories.pop();
}
else if (rawDirectories[i] !== ".") {
else if (rawDirectories[i] !== '.') {
directories.push(rawDirectories[i]);

@@ -122,7 +122,7 @@ }

returner.directories = directories;
returner.rawPath = (urlParts[1] || "") + rawDirectories.join("/");
returner.path = (urlParts[1] || "") + directories.join("/");
returner.rawPath = (urlParts[1] || '') + rawDirectories.join('/');
returner.path = (urlParts[1] || '') + directories.join('/');
returner.filename = urlParts[4];
returner.fileUrl = returner.path + (urlParts[4] || "");
returner.url = returner.fileUrl + (urlParts[5] || "");
returner.fileUrl = returner.path + (urlParts[4] || '');
returner.url = returner.fileUrl + (urlParts[5] || '');
return returner;

@@ -129,0 +129,0 @@ };

@@ -1,2 +0,2 @@

var functionRegistry = require("../functions/function-registry"),
var functionRegistry = require('../functions/function-registry'),
LessError = require('../less-error');

@@ -27,3 +27,3 @@

if (fileInfo) {
if (typeof fileInfo === "string") {
if (typeof fileInfo === 'string') {
filename = fileInfo;

@@ -66,3 +66,3 @@ }

try {
loader = new Function("module", "require", "registerPlugin", "functions", "tree", "less", "fileInfo", contents);
loader = new Function('module', 'require', 'registerPlugin', 'functions', 'tree', 'less', 'fileInfo', contents);
loader(localModule, this.require, registerPlugin, registry, this.less.tree, this.less, fileInfo);

@@ -100,3 +100,3 @@ } catch (e) {

else {
return new this.less.LessError({ message: "Not a valid plugin" });
return new this.less.LessError({ message: 'Not a valid plugin' });
}

@@ -111,3 +111,3 @@

if (!plugin.setOptions) {
error("Options have been provided but the plugin " + name + " does not support any options.");
error('Options have been provided but the plugin ' + name + ' does not support any options.');
return null;

@@ -119,3 +119,3 @@ }

catch (e) {
error("Error setting options on plugin " + name + '\n' + e.message);
error('Error setting options on plugin ' + name + '\n' + e.message);
return null;

@@ -130,3 +130,3 @@ }

// so that the plugin can be more usable programmatically
if (typeof plugin === "function") {
if (typeof plugin === 'function') {
plugin = new plugin();

@@ -137,3 +137,3 @@ }

if (this.compareVersion(plugin.minVersion, this.less.version) < 0) {
error("Plugin " + name + " requires version " + this.versionToString(plugin.minVersion));
error('Plugin ' + name + ' requires version ' + this.versionToString(plugin.minVersion));
return null;

@@ -148,3 +148,3 @@ }

AbstractPluginLoader.prototype.compareVersion = function(aVersion, bVersion) {
if (typeof aVersion === "string") {
if (typeof aVersion === 'string') {
aVersion = aVersion.match(/^(\d+)\.?(\d+)?\.?(\d+)?/);

@@ -161,5 +161,5 @@ aVersion.shift();

AbstractPluginLoader.prototype.versionToString = function(version) {
var versionString = "";
var versionString = '';
for (var i = 0; i < version.length; i++) {
versionString += (versionString ? "." : "") + version[i];
versionString += (versionString ? '.' : '') + version[i];
}

@@ -166,0 +166,0 @@ return versionString;

@@ -6,3 +6,3 @@ /**

var logger = require("../logger");
var logger = require('../logger');
var environment = function(externalEnvironment, fileManagers) {

@@ -12,3 +12,3 @@ this.fileManagers = fileManagers || [];

var optionalFunctions = ["encodeBase64", "mimeLookup", "charsetLookup", "getSourceMapGenerator"],
var optionalFunctions = ['encodeBase64', 'mimeLookup', 'charsetLookup', 'getSourceMapGenerator'],
requiredFunctions = [],

@@ -23,3 +23,3 @@ functions = requiredFunctions.concat(optionalFunctions);

} else if (i < requiredFunctions.length) {
this.warn("missing required function in environment - " + propName);
this.warn('missing required function in environment - ' + propName);
}

@@ -32,6 +32,6 @@ }

if (!filename) {
logger.warn("getFileManager called with no filename.. Please report this issue. continuing.");
logger.warn('getFileManager called with no filename.. Please report this issue. continuing.');
}
if (currentDirectory == null) {
logger.warn("getFileManager called with null directory.. Please report this issue. continuing.");
logger.warn('getFileManager called with null directory.. Please report this issue. continuing.');
}

@@ -45,3 +45,3 @@

var fileManager = fileManagers[i];
if (fileManager[isSync ? "supportsSync" : "supports"](filename, currentDirectory, options, environment)) {
if (fileManager[isSync ? 'supportsSync' : 'supports'](filename, currentDirectory, options, environment)) {
return fileManager;

@@ -48,0 +48,0 @@ }

var functionRegistry = require("./function-registry"),
Anonymous = require("../tree/anonymous"),
Keyword = require("../tree/keyword");
var functionRegistry = require('./function-registry'),
Anonymous = require('../tree/anonymous'),
Keyword = require('../tree/keyword');

@@ -6,0 +6,0 @@ functionRegistry.addMultiple({

@@ -1,3 +0,3 @@

var Color = require("../tree/color"),
functionRegistry = require("./function-registry");
var Color = require('../tree/color'),
functionRegistry = require('./function-registry');

@@ -4,0 +4,0 @@ // Color Blending

@@ -1,6 +0,6 @@

var Dimension = require("../tree/dimension"),
Color = require("../tree/color"),
Quoted = require("../tree/quoted"),
Anonymous = require("../tree/anonymous"),
functionRegistry = require("./function-registry"),
var Dimension = require('../tree/dimension'),
Color = require('../tree/color'),
Quoted = require('../tree/quoted'),
Anonymous = require('../tree/anonymous'),
functionRegistry = require('./function-registry'),
colorFunctions;

@@ -21,4 +21,4 @@

throw {
type: "Argument",
message: "color functions take numbers as parameters"
type: 'Argument',
message: 'color functions take numbers as parameters'
};

@@ -156,3 +156,3 @@ }

if (typeof method !== "undefined" && method.value === "relative") {
if (typeof method !== 'undefined' && method.value === 'relative') {
hsl.s += hsl.s * amount.value / 100;

@@ -169,3 +169,3 @@ }

if (typeof method !== "undefined" && method.value === "relative") {
if (typeof method !== 'undefined' && method.value === 'relative') {
hsl.s -= hsl.s * amount.value / 100;

@@ -182,3 +182,3 @@ }

if (typeof method !== "undefined" && method.value === "relative") {
if (typeof method !== 'undefined' && method.value === 'relative') {
hsl.l += hsl.l * amount.value / 100;

@@ -195,3 +195,3 @@ }

if (typeof method !== "undefined" && method.value === "relative") {
if (typeof method !== 'undefined' && method.value === 'relative') {
hsl.l -= hsl.l * amount.value / 100;

@@ -208,3 +208,3 @@ }

if (typeof method !== "undefined" && method.value === "relative") {
if (typeof method !== 'undefined' && method.value === 'relative') {
hsl.a += hsl.a * amount.value / 100;

@@ -221,3 +221,3 @@ }

if (typeof method !== "undefined" && method.value === "relative") {
if (typeof method !== 'undefined' && method.value === 'relative') {
hsl.a -= hsl.a * amount.value / 100;

@@ -356,4 +356,4 @@ }

throw {
type: "Argument",
message: "argument must be a color keyword or 3/6 digit hex e.g. #FFF"
type: 'Argument',
message: 'argument must be a color keyword or 3/6 digit hex e.g. #FFF'
};

@@ -360,0 +360,0 @@ },

module.exports = function(environment) {
var Quoted = require("../tree/quoted"),
URL = require("../tree/url"),
var Quoted = require('../tree/quoted'),
URL = require('../tree/url'),
utils = require('../utils'),
functionRegistry = require("./function-registry"),
functionRegistry = require('./function-registry'),
fallback = function(functionThis, node) {

@@ -11,3 +11,3 @@ return new URL(node, functionThis.index, functionThis.currentFileInfo).eval(functionThis.context);

functionRegistry.add("data-uri", function(mimetypeNode, filePathNode) {
functionRegistry.add('data-uri', function(mimetypeNode, filePathNode) {

@@ -47,3 +47,3 @@ if (!filePathNode) {

if (mimetype === "image/svg+xml") {
if (mimetype === 'image/svg+xml') {
useBase64 = false;

@@ -63,3 +63,3 @@ } else {

if (!fileSync.contents) {
logger.warn("Skipped data-uri embedding of " + filePath + " because file not found");
logger.warn('Skipped data-uri embedding of ' + filePath + ' because file not found');
return fallback(this, filePathNode || mimetypeNode);

@@ -74,3 +74,3 @@ }

var uri = "data:" + mimetype + ',' + buf + fragment;
var uri = 'data:' + mimetype + ',' + buf + fragment;

@@ -83,4 +83,4 @@ // IE8 cannot handle a data-uri larger than 32,768 characters. If this is exceeded

if (this.context.ieCompat !== false) {
logger.warn("Skipped data-uri embedding of " + filePath + " because its size (" + uri.length +
" characters) exceeds IE8-safe " + DATA_URI_MAX + " characters!");
logger.warn('Skipped data-uri embedding of ' + filePath + ' because its size (' + uri.length +
' characters) exceeds IE8-safe ' + DATA_URI_MAX + ' characters!');

@@ -87,0 +87,0 @@ return fallback(this, filePathNode || mimetypeNode);

@@ -1,3 +0,3 @@

var Keyword = require("../tree/keyword"),
functionRegistry = require("./function-registry");
var Keyword = require('../tree/keyword'),
functionRegistry = require('./function-registry');

@@ -25,4 +25,4 @@ var defaultFunc = {

functionRegistry.add("default", defaultFunc.eval.bind(defaultFunc));
functionRegistry.add('default', defaultFunc.eval.bind(defaultFunc));
module.exports = defaultFunc;

@@ -1,2 +0,2 @@

var Expression = require("../tree/expression");
var Expression = require('../tree/expression');

@@ -20,3 +20,3 @@ var functionCaller = function(name, context, index, currentFileInfo) {

args = args.filter(function (item) {
if (item.type === "Comment") {
if (item.type === 'Comment') {
return false;

@@ -27,5 +27,5 @@ }

.map(function(item) {
if (item.type === "Expression") {
if (item.type === 'Expression') {
var subNodes = item.value.filter(function (item) {
if (item.type === "Comment") {
if (item.type === 'Comment') {
return false;

@@ -32,0 +32,0 @@ }

module.exports = function(environment) {
var functions = {
functionRegistry: require("./function-registry"),
functionCaller: require("./function-caller")
functionRegistry: require('./function-registry'),
functionCaller: require('./function-caller')
};
// register functions
require("./boolean");
require("./default");
require("./color");
require("./color-blending");
require("./data-uri")(environment);
require("./math");
require("./number");
require("./string");
require("./svg")(environment);
require("./types");
require('./boolean');
require('./default');
require('./color');
require('./color-blending');
require('./data-uri')(environment);
require('./math');
require('./number');
require('./string');
require('./svg')(environment);
require('./types');
return functions;
};

@@ -1,2 +0,2 @@

var Dimension = require("../tree/dimension");
var Dimension = require('../tree/dimension');

@@ -7,3 +7,3 @@ var MathHelper = function() {

if (!(n instanceof Dimension)) {
throw { type: "Argument", message: "argument must be a number" };
throw { type: 'Argument', message: 'argument must be a number' };
}

@@ -10,0 +10,0 @@ if (unit == null) {

@@ -1,3 +0,3 @@

var functionRegistry = require("./function-registry"),
mathHelper = require("./math-helper.js");
var functionRegistry = require('./function-registry'),
mathHelper = require('./math-helper.js');

@@ -10,8 +10,8 @@ var mathFunctions = {

abs: null,
tan: "",
sin: "",
cos: "",
atan: "rad",
asin: "rad",
acos: "rad"
tan: '',
sin: '',
cos: '',
atan: 'rad',
asin: 'rad',
acos: 'rad'
};

@@ -26,3 +26,3 @@

mathFunctions.round = function (n, f) {
var fraction = typeof f === "undefined" ? 0 : f.value;
var fraction = typeof f === 'undefined' ? 0 : f.value;
return mathHelper._math(function(num) { return num.toFixed(fraction); }, null, n);

@@ -29,0 +29,0 @@ };

@@ -1,5 +0,5 @@

var Dimension = require("../tree/dimension"),
Anonymous = require("../tree/anonymous"),
functionRegistry = require("./function-registry"),
mathHelper = require("./math-helper.js");
var Dimension = require('../tree/dimension'),
Anonymous = require('../tree/anonymous'),
functionRegistry = require('./function-registry'),
mathHelper = require('./math-helper.js');

@@ -9,3 +9,3 @@ var minMax = function (isMin, args) {

switch (args.length) {
case 0: throw { type: "Argument", message: "one or more arguments required" };
case 0: throw { type: 'Argument', message: 'one or more arguments required' };
}

@@ -24,10 +24,10 @@ var i, j, current, currentUnified, referenceUnified, unit, unitStatic, unitClone,

}
currentUnified = current.unit.toString() === "" && unitClone !== undefined ? new Dimension(current.value, unitClone).unify() : current.unify();
unit = currentUnified.unit.toString() === "" && unitStatic !== undefined ? unitStatic : currentUnified.unit.toString();
unitStatic = unit !== "" && unitStatic === undefined || unit !== "" && order[0].unify().unit.toString() === "" ? unit : unitStatic;
unitClone = unit !== "" && unitClone === undefined ? current.unit.toString() : unitClone;
j = values[""] !== undefined && unit !== "" && unit === unitStatic ? values[""] : values[unit];
currentUnified = current.unit.toString() === '' && unitClone !== undefined ? new Dimension(current.value, unitClone).unify() : current.unify();
unit = currentUnified.unit.toString() === '' && unitStatic !== undefined ? unitStatic : currentUnified.unit.toString();
unitStatic = unit !== '' && unitStatic === undefined || unit !== '' && order[0].unify().unit.toString() === '' ? unit : unitStatic;
unitClone = unit !== '' && unitClone === undefined ? current.unit.toString() : unitClone;
j = values[''] !== undefined && unit !== '' && unit === unitStatic ? values[''] : values[unit];
if (j === undefined) {
if (unitStatic !== undefined && unit !== unitStatic) {
throw { type: "Argument", message: "incompatible types" };
throw { type: 'Argument', message: 'incompatible types' };
}

@@ -38,3 +38,3 @@ values[unit] = order.length;

}
referenceUnified = order[j].unit.toString() === "" && unitClone !== undefined ? new Dimension(order[j].value, unitClone).unify() : order[j].unify();
referenceUnified = order[j].unit.toString() === '' && unitClone !== undefined ? new Dimension(order[j].value, unitClone).unify() : order[j].unify();
if ( isMin && currentUnified.value < referenceUnified.value ||

@@ -48,4 +48,4 @@ !isMin && currentUnified.value > referenceUnified.value) {

}
args = order.map(function (a) { return a.toCSS(this.context); }).join(this.context.compress ? "," : ", ");
return new Anonymous((isMin ? "min" : "max") + "(" + args + ")");
args = order.map(function (a) { return a.toCSS(this.context); }).join(this.context.compress ? ',' : ', ');
return new Anonymous((isMin ? 'min' : 'max') + '(' + args + ')');
};

@@ -69,7 +69,7 @@ functionRegistry.addMultiple({

pow: function(x, y) {
if (typeof x === "number" && typeof y === "number") {
if (typeof x === 'number' && typeof y === 'number') {
x = new Dimension(x);
y = new Dimension(y);
} else if (!(x instanceof Dimension) || !(y instanceof Dimension)) {
throw { type: "Argument", message: "arguments must be numbers" };
throw { type: 'Argument', message: 'arguments must be numbers' };
}

@@ -76,0 +76,0 @@

@@ -1,5 +0,5 @@

var Quoted = require("../tree/quoted"),
Anonymous = require("../tree/anonymous"),
JavaScript = require("../tree/javascript"),
functionRegistry = require("./function-registry");
var Quoted = require('../tree/quoted'),
Anonymous = require('../tree/anonymous'),
JavaScript = require('../tree/javascript'),
functionRegistry = require('./function-registry');

@@ -12,8 +12,8 @@ functionRegistry.addMultiple({

return new Anonymous(
encodeURI(str.value).replace(/=/g, "%3D").replace(/:/g, "%3A").replace(/#/g, "%23").replace(/;/g, "%3B")
.replace(/\(/g, "%28").replace(/\)/g, "%29"));
encodeURI(str.value).replace(/=/g, '%3D').replace(/:/g, '%3A').replace(/#/g, '%23').replace(/;/g, '%3B')
.replace(/\(/g, '%28').replace(/\)/g, '%29'));
},
replace: function (string, pattern, replacement, flags) {
var result = string.value;
replacement = (replacement.type === "Quoted") ?
replacement = (replacement.type === 'Quoted') ?
replacement.value : replacement.toCSS();

@@ -30,3 +30,3 @@ result = result.replace(new RegExp(pattern.value, flags ? flags.value : ''), replacement);

result = result.replace(/%[sda]/i, function(token) {
var value = ((args[i].type === "Quoted") &&
var value = ((args[i].type === 'Quoted') &&
token.match(/s/i)) ? args[i].value : args[i].toCSS();

@@ -33,0 +33,0 @@ return token.match(/[A-Z]$/) ? encodeURIComponent(value) : value;

module.exports = function(environment) {
var Dimension = require("../tree/dimension"),
Color = require("../tree/color"),
Expression = require("../tree/expression"),
Quoted = require("../tree/quoted"),
URL = require("../tree/url"),
functionRegistry = require("./function-registry");
var Dimension = require('../tree/dimension'),
Color = require('../tree/color'),
Expression = require('../tree/expression'),
Quoted = require('../tree/quoted'),
URL = require('../tree/url'),
functionRegistry = require('./function-registry');
functionRegistry.add("svg-gradient", function(direction) {
functionRegistry.add('svg-gradient', function(direction) {
var stops,
gradientDirectionSvg,
gradientType = "linear",
gradientType = 'linear',
rectangleDimension = 'x="0" y="0" width="1" height="1"',

@@ -21,5 +21,5 @@ renderEnv = {compress: false},

function throwArgumentDescriptor() {
throw { type: "Argument",
message: "svg-gradient expects direction, start_color [start_position], [color position,]...," +
" end_color [end_position] or direction, color list" };
throw { type: 'Argument',
message: 'svg-gradient expects direction, start_color [start_position], [color position,]...,' +
' end_color [end_position] or direction, color list' };
}

@@ -39,17 +39,17 @@

switch (directionValue) {
case "to bottom":
case 'to bottom':
gradientDirectionSvg = 'x1="0%" y1="0%" x2="0%" y2="100%"';
break;
case "to right":
case 'to right':
gradientDirectionSvg = 'x1="0%" y1="0%" x2="100%" y2="0%"';
break;
case "to bottom right":
case 'to bottom right':
gradientDirectionSvg = 'x1="0%" y1="0%" x2="100%" y2="100%"';
break;
case "to top right":
case 'to top right':
gradientDirectionSvg = 'x1="0%" y1="100%" x2="100%" y2="0%"';
break;
case "ellipse":
case "ellipse at center":
gradientType = "radial";
case 'ellipse':
case 'ellipse at center':
gradientType = 'radial';
gradientDirectionSvg = 'cx="50%" cy="50%" r="75%"';

@@ -59,4 +59,4 @@ rectangleDimension = 'x="-50" y="-50" width="101" height="101"';

default:
throw { type: "Argument", message: "svg-gradient direction must be 'to bottom', 'to right'," +
" 'to bottom right', 'to top right' or 'ellipse at center'" };
throw { type: 'Argument', message: 'svg-gradient direction must be \'to bottom\', \'to right\',' +
' \'to bottom right\', \'to top right\' or \'ellipse at center\'' };
}

@@ -79,3 +79,3 @@ returner = '<?xml version="1.0" ?>' +

}
positionValue = position ? position.toCSS(renderEnv) : i === 0 ? "0%" : "100%";
positionValue = position ? position.toCSS(renderEnv) : i === 0 ? '0%' : '100%';
alpha = color.alpha;

@@ -89,5 +89,5 @@ returner += '<stop offset="' + positionValue + '" stop-color="' + color.toRGB() + '"' + (alpha < 1 ? ' stop-opacity="' + alpha + '"' : '') + '/>';

returner = "data:image/svg+xml," + returner;
return new URL(new Quoted("'" + returner + "'", returner, false, this.index, this.currentFileInfo), this.index, this.currentFileInfo);
returner = 'data:image/svg+xml,' + returner;
return new URL(new Quoted('\'' + returner + '\'', returner, false, this.index, this.currentFileInfo), this.index, this.currentFileInfo);
});
};

@@ -1,10 +0,10 @@

var Keyword = require("../tree/keyword"),
DetachedRuleset = require("../tree/detached-ruleset"),
Dimension = require("../tree/dimension"),
Color = require("../tree/color"),
Quoted = require("../tree/quoted"),
Anonymous = require("../tree/anonymous"),
URL = require("../tree/url"),
Operation = require("../tree/operation"),
functionRegistry = require("./function-registry");
var Keyword = require('../tree/keyword'),
DetachedRuleset = require('../tree/detached-ruleset'),
Dimension = require('../tree/dimension'),
Color = require('../tree/color'),
Quoted = require('../tree/quoted'),
Anonymous = require('../tree/anonymous'),
URL = require('../tree/url'),
Operation = require('../tree/operation'),
functionRegistry = require('./function-registry');

@@ -16,7 +16,7 @@ var isa = function (n, Type) {

if (unit === undefined) {
throw { type: "Argument", message: "missing the required second argument to isunit." };
throw { type: 'Argument', message: 'missing the required second argument to isunit.' };
}
unit = typeof unit.value === "string" ? unit.value : unit;
if (typeof unit !== "string") {
throw { type: "Argument", message: "Second argument to isunit should be a unit or a string." };
unit = typeof unit.value === 'string' ? unit.value : unit;
if (typeof unit !== 'string') {
throw { type: 'Argument', message: 'Second argument to isunit should be a unit or a string.' };
}

@@ -64,5 +64,5 @@ return (n instanceof Dimension) && n.unit.is(unit) ? Keyword.True : Keyword.False;

if (!(val instanceof Dimension)) {
throw { type: "Argument",
message: "the first argument to unit must be a number" +
(val instanceof Operation ? ". Have you forgotten parenthesis?" : "") };
throw { type: 'Argument',
message: 'the first argument to unit must be a number' +
(val instanceof Operation ? '. Have you forgotten parenthesis?' : '') };
}

@@ -76,7 +76,7 @@ if (unit) {

} else {
unit = "";
unit = '';
}
return new Dimension(val.value, unit);
},
"get-unit": function (n) {
'get-unit': function (n) {
return new Anonymous(n.unit);

@@ -83,0 +83,0 @@ },

@@ -1,6 +0,7 @@

var contexts = require("./contexts"),
var contexts = require('./contexts'),
Parser = require('./parser/parser'),
LessError = require('./less-error'),
utils = require('./utils'),
PromiseConstructor = typeof Promise === 'undefined' ? require('promise') : Promise;
PromiseConstructor = typeof Promise === 'undefined' ? require('promise') : Promise,
logger = require('./logger');

@@ -31,3 +32,3 @@ module.exports = function(environment) {

};
/**

@@ -53,2 +54,3 @@ * Add an import to be imported

callback(null, {rules:[]}, false, null);
logger.info('The file ' + fullPath + ' was skipped because it was not found and the import was marked optional.');
}

@@ -61,3 +63,3 @@ else {

importManager.files[fullPath] = { root: root, options: importOptions };
}
}
if (e && !importManager.error) { importManager.error = e; }

@@ -78,3 +80,3 @@ callback(e, root, importedEqualsRoot, fullPath);

if (!fileManager) {
fileParsedFunc({ message: "Could not find a file-manager for " + path });
fileParsedFunc({ message: 'Could not find a file-manager for ' + path });
return;

@@ -99,3 +101,3 @@ }

newFileInfo.rootpath = fileManager.join(
(importManager.context.rootpath || ""),
(importManager.context.rootpath || ''),
fileManager.pathDiff(newFileInfo.currentDirectory, newFileInfo.entryPath));

@@ -129,6 +131,6 @@

} else {
// import (multiple) parse trees apparently get altered and can't be cached.
// TODO: investigate why this is
if (importManager.files[resolvedFilename]
if (importManager.files[resolvedFilename]
&& !importManager.files[resolvedFilename].options.multiple

@@ -149,3 +151,3 @@ && !importOptions.multiple) {

if (tryAppendExtension) {
context.ext = importOptions.isPlugin ? ".js" : ".less";
context.ext = importOptions.isPlugin ? '.js' : '.less';
}

@@ -157,3 +159,3 @@

else {
promise = fileManager.loadFile(path, currentFileInfo.currentDirectory, context, environment,
promise = fileManager.loadFile(path, currentFileInfo.currentDirectory, context, environment,
function(err, loadedFile) {

@@ -160,0 +162,0 @@ if (err) {

@@ -5,8 +5,8 @@ module.exports = function(environment, fileManagers) {

var initial = {
version: [3, 0, 4],
version: [3, 5, 0],
data: require('./data'),
tree: require('./tree'),
Environment: (Environment = require("./environment/environment")),
AbstractFileManager: require("./environment/abstract-file-manager"),
AbstractPluginLoader: require("./environment/abstract-plugin-loader"),
Environment: (Environment = require('./environment/environment')),
AbstractFileManager: require('./environment/abstract-file-manager'),
AbstractPluginLoader: require('./environment/abstract-plugin-loader'),
environment: (environment = new Environment(environment, fileManagers)),

@@ -16,3 +16,3 @@ visitors: require('./visitors'),

functions: require('./functions')(environment),
contexts: require("./contexts"),
contexts: require('./contexts'),
SourceMapOutput: (SourceMapOutput = require('./source-map-output')(environment)),

@@ -22,4 +22,4 @@ SourceMapBuilder: (SourceMapBuilder = require('./source-map-builder')(SourceMapOutput, environment)),

ImportManager: (ImportManager = require('./import-manager')(environment)),
render: require("./render")(environment, ParseTree, ImportManager),
parse: require("./parse")(environment, ParseTree, ImportManager),
render: require('./render')(environment, ParseTree, ImportManager),
parse: require('./parse')(environment, ParseTree, ImportManager),
LessError: require('./less-error'),

@@ -45,3 +45,3 @@ transformTree: require('./transform-tree'),

t = initial.tree[n];
if (typeof t === "function") {
if (typeof t === 'function') {
api[n.toLowerCase()] = ctor(t);

@@ -48,0 +48,0 @@ }

module.exports = {
error: function(msg) {
this._fireEvent("error", msg);
this._fireEvent('error', msg);
},
warn: function(msg) {
this._fireEvent("warn", msg);
this._fireEvent('warn', msg);
},
info: function(msg) {
this._fireEvent("info", msg);
this._fireEvent('info', msg);
},
debug: function(msg) {
this._fireEvent("debug", msg);
this._fireEvent('debug', msg);
},

@@ -14,0 +14,0 @@ addListener: function(listener) {

var LessError = require('./less-error'),
transformTree = require("./transform-tree"),
logger = require("./logger");
transformTree = require('./transform-tree'),
logger = require('./logger');

@@ -22,3 +22,3 @@ module.exports = function(SourceMapBuilder) {

if (compress) {
logger.warn("The compress option has been deprecated. We recommend you use a dedicated css minifier, for instance see less-plugin-clean-css.");
logger.warn('The compress option has been deprecated. We recommend you use a dedicated css minifier, for instance see less-plugin-clean-css.');
}

@@ -25,0 +25,0 @@

var PromiseConstructor,
contexts = require("./contexts"),
contexts = require('./contexts'),
Parser = require('./parser/parser'),

@@ -45,8 +45,8 @@ PluginManager = require('./plugin-manager'),

} else {
var filename = options.filename || "input";
var entryPath = filename.replace(/[^\/\\]*$/, "");
var filename = options.filename || 'input';
var entryPath = filename.replace(/[^\/\\]*$/, '');
rootFileInfo = {
filename: filename,
relativeUrls: context.relativeUrls,
rootpath: context.rootpath || "",
rootpath: context.rootpath || '',
currentDirectory: entryPath,

@@ -57,4 +57,4 @@ entryPath: entryPath,

// add in a missing trailing slash
if (rootFileInfo.rootpath && rootFileInfo.rootpath.slice(-1) !== "/") {
rootFileInfo.rootpath += "/";
if (rootFileInfo.rootpath && rootFileInfo.rootpath.slice(-1) !== '/') {
rootFileInfo.rootpath += '/';
}

@@ -61,0 +61,0 @@ }

@@ -31,3 +31,3 @@ // Split the input into chunks.

if (--parenLevel < 0) {
return fail("missing opening `(`", chunkerCurrentIndex);
return fail('missing opening `(`', chunkerCurrentIndex);
}

@@ -44,3 +44,3 @@ continue;

if (--level < 0) {
return fail("missing opening `{`", chunkerCurrentIndex);
return fail('missing opening `{`', chunkerCurrentIndex);
}

@@ -51,3 +51,3 @@ if (!level && !parenLevel) { emitChunk(); }

if (chunkerCurrentIndex < len - 1) { chunkerCurrentIndex++; continue; }
return fail("unescaped `\\`", chunkerCurrentIndex);
return fail('unescaped `\\`', chunkerCurrentIndex);
case 34:

@@ -64,3 +64,3 @@ case 39:

if (chunkerCurrentIndex == len - 1) {
return fail("unescaped `\\`", chunkerCurrentIndex);
return fail('unescaped `\\`', chunkerCurrentIndex);
}

@@ -71,3 +71,3 @@ chunkerCurrentIndex++;

if (matched) { continue; }
return fail("unmatched `" + String.fromCharCode(cc) + "`", currentChunkStartIndex);
return fail('unmatched `' + String.fromCharCode(cc) + '`', currentChunkStartIndex);
case 47: // /, check for comment

@@ -92,3 +92,3 @@ if (parenLevel || (chunkerCurrentIndex == len - 1)) { continue; }

if (chunkerCurrentIndex == len - 1) {
return fail("missing closing `*/`", currentChunkStartIndex);
return fail('missing closing `*/`', currentChunkStartIndex);
}

@@ -100,3 +100,3 @@ chunkerCurrentIndex++;

if ((chunkerCurrentIndex < len - 1) && (input.charCodeAt(chunkerCurrentIndex + 1) == 47)) {
return fail("unmatched `/*`", chunkerCurrentIndex);
return fail('unmatched `/*`', chunkerCurrentIndex);
}

@@ -109,8 +109,8 @@ continue;

if ((lastMultiComment > lastOpening) && (lastMultiCommentEndBrace > lastMultiComment)) {
return fail("missing closing `}` or `*/`", lastOpening);
return fail('missing closing `}` or `*/`', lastOpening);
} else {
return fail("missing closing `}`", lastOpening);
return fail('missing closing `}`', lastOpening);
}
} else if (parenLevel !== 0) {
return fail("missing closing `)`", lastOpeningParen);
return fail('missing closing `)`', lastOpeningParen);
}

@@ -117,0 +117,0 @@

@@ -38,3 +38,3 @@ var chunker = require('./chunker');

comment = {index: parserInput.i, isLineComment: true};
var nextNewLine = inp.indexOf("\n", parserInput.i + 2);
var nextNewLine = inp.indexOf('\n', parserInput.i + 2);
if (nextNewLine < 0) {

@@ -48,3 +48,3 @@ nextNewLine = endIndex;

} else if (nextChar === '*') {
var nextStarSlash = inp.indexOf("*/", parserInput.i + 2);
var nextStarSlash = inp.indexOf('*/', parserInput.i + 2);
if (nextStarSlash >= 0) {

@@ -121,3 +121,3 @@ comment = {

skipWhitespace(m[0].length);
if (typeof m === "string") {
if (typeof m === 'string') {
return m;

@@ -151,10 +151,11 @@ }

parserInput.$quoted = function() {
parserInput.$quoted = function(loc) {
var pos = loc || parserInput.i,
startChar = input.charAt(pos);
var startChar = input.charAt(parserInput.i);
if (startChar !== "'" && startChar !== '"') {
if (startChar !== '\'' && startChar !== '"') {
return;
}
var length = input.length,
currentPosition = parserInput.i;
currentPosition = pos;

@@ -164,12 +165,15 @@ for (var i = 1; i + currentPosition < length; i++) {

switch (nextChar) {
case "\\":
case '\\':
i++;
continue;
case "\r":
case "\n":
case '\r':
case '\n':
break;
case startChar:
var str = input.substr(currentPosition, i + 1);
skipWhitespace(i + 1);
return str;
if (!loc && loc !== 0) {
skipWhitespace(i + 1);
return str
}
return [startChar, str];
default:

@@ -181,2 +185,119 @@ }

/**
* Permissive parsing. Ignores everything except matching {} [] () and quotes
* until matching token (outside of blocks)
*/
parserInput.$parseUntil = function(tok) {
var quote = '',
returnVal = null,
inComment = false,
blockDepth = 0,
blockStack = [],
parseGroups = [],
length = input.length,
startPos = parserInput.i,
lastPos = parserInput.i,
i = parserInput.i,
loop = true,
testChar;
if (typeof tok === 'string') {
testChar = function(char) {
return char === tok;
}
} else {
testChar = function(char) {
return tok.test(char);
}
}
do {
var prevChar, nextChar = input.charAt(i);
if (blockDepth === 0 && testChar(nextChar)) {
returnVal = input.substr(lastPos, i - lastPos);
if (returnVal) {
parseGroups.push(returnVal);
returnVal = parseGroups;
}
else {
returnVal = [' '];
}
skipWhitespace(i - startPos);
loop = false
} else {
if (inComment) {
if (nextChar === '*' &&
input.charAt(i + 1) === '/') {
i++;
blockDepth--;
inComment = false;
}
i++;
continue;
}
switch (nextChar) {
case '\\':
i++;
nextChar = input.charAt(i);
parseGroups.push(input.substr(lastPos, i - lastPos + 1));
lastPos = i + 1;
break;
case '/':
if (input.charAt(i + 1) === '*') {
i++;
console.log(input.substr(lastPos, i - lastPos));
inComment = true;
blockDepth++;
}
break;
case '\'':
case '"':
quote = parserInput.$quoted(i);
if (quote) {
parseGroups.push(input.substr(lastPos, i - lastPos), quote);
i += quote[1].length - 1;
lastPos = i + 1;
}
else {
skipWhitespace(i - startPos);
returnVal = nextChar;
loop = false;
}
break;
case '{':
blockStack.push('}');
blockDepth++;
break;
case '(':
blockStack.push(')');
blockDepth++;
break;
case '[':
blockStack.push(']');
blockDepth++;
break;
case '}':
case ')':
case ']':
var expected = blockStack.pop();
if (nextChar === expected) {
blockDepth--;
} else {
// move the parser to the error and return expected
skipWhitespace(i - startPos);
returnVal = expected;
loop = false;
}
}
i++;
if (i > length) {
loop = false;
}
}
prevChar = nextChar;
} while (loop);
return returnVal ? returnVal : null;
}
parserInput.autoCommentAbsorb = true;

@@ -183,0 +304,0 @@ parserInput.commentStore = [];

@@ -40,11 +40,11 @@ module.exports = function (SourceMapOutput, environment) {

if (this.sourceMap === undefined) {
return "";
return '';
}
sourceMapURL = "data:application/json;base64," + environment.encodeBase64(this.sourceMap);
sourceMapURL = 'data:application/json;base64,' + environment.encodeBase64(this.sourceMap);
}
if (sourceMapURL) {
return "/*# sourceMappingURL=" + sourceMapURL + " */";
return '/*# sourceMappingURL=' + sourceMapURL + ' */';
}
return "";
return '';
};

@@ -51,0 +51,0 @@

@@ -22,3 +22,3 @@ module.exports = function (environment) {

} else {
this._sourceMapRootpath = "";
this._sourceMapRootpath = '';
}

@@ -46,3 +46,3 @@ this._outputSourceFiles = options.outputSourceFiles;

filename = this.removeBasepath(filename);
return (this._sourceMapRootpath || "") + filename;
return (this._sourceMapRootpath || '') + filename;
};

@@ -75,7 +75,7 @@

inputSource = inputSource.substring(0, index);
sourceLines = inputSource.split("\n");
sourceLines = inputSource.split('\n');
sourceColumns = sourceLines[sourceLines.length - 1];
}
lines = chunk.split("\n");
lines = chunk.split('\n');
columns = lines[lines.length - 1];

@@ -82,0 +82,0 @@

@@ -1,4 +0,4 @@

var contexts = require("./contexts"),
visitor = require("./visitors"),
tree = require("./tree");
var contexts = require('./contexts'),
visitor = require('./visitors'),
tree = require('./tree');

@@ -5,0 +5,0 @@ module.exports = function(root, options) {

@@ -1,2 +0,2 @@

var Node = require("./node");
var Node = require('./node');

@@ -13,3 +13,3 @@ var Anonymous = function (value, index, currentFileInfo, mapLines, rulesetLike, visibilityInfo) {

Anonymous.prototype = new Node();
Anonymous.prototype.type = "Anonymous";
Anonymous.prototype.type = 'Anonymous';
Anonymous.prototype.eval = function () {

@@ -16,0 +16,0 @@ return new Anonymous(this.value, this._index, this._fileInfo, this.mapLines, this.rulesetLike, this.visibilityInfo());

@@ -1,2 +0,2 @@

var Node = require("./node");
var Node = require('./node');

@@ -9,3 +9,3 @@ var Assignment = function (key, val) {

Assignment.prototype = new Node();
Assignment.prototype.type = "Assignment";
Assignment.prototype.type = 'Assignment';
Assignment.prototype.accept = function (visitor) {

@@ -12,0 +12,0 @@ this.value = visitor.visit(this.value);

@@ -1,4 +0,4 @@

var Node = require("./node"),
Selector = require("./selector"),
Ruleset = require("./ruleset"),
var Node = require('./node'),
Selector = require('./selector'),
Ruleset = require('./ruleset'),
Anonymous = require('./anonymous');

@@ -32,3 +32,3 @@

AtRule.prototype = new Node();
AtRule.prototype.type = "AtRule";
AtRule.prototype.type = 'AtRule';
AtRule.prototype.accept = function (visitor) {

@@ -47,3 +47,3 @@ var value = this.value, rules = this.rules;

AtRule.prototype.isCharset = function() {
return "@charset" === this.name;
return '@charset' === this.name;
};

@@ -123,7 +123,7 @@ AtRule.prototype.genCSS = function (context, output) {

// Non-compressed
var tabSetStr = '\n' + Array(context.tabLevel).join(" "), tabRuleStr = tabSetStr + " ";
var tabSetStr = '\n' + Array(context.tabLevel).join(' '), tabRuleStr = tabSetStr + ' ';
if (!ruleCnt) {
output.add(" {" + tabSetStr + '}');
output.add(' {' + tabSetStr + '}');
} else {
output.add(" {" + tabRuleStr);
output.add(' {' + tabRuleStr);
rules[0].genCSS(context, output);

@@ -130,0 +130,0 @@ for (i = 1; i < ruleCnt; i++) {

@@ -1,2 +0,2 @@

var Node = require("./node");
var Node = require('./node');

@@ -9,3 +9,3 @@ var Attribute = function (key, op, value) {

Attribute.prototype = new Node();
Attribute.prototype.type = "Attribute";
Attribute.prototype.type = 'Attribute';
Attribute.prototype.eval = function (context) {

@@ -12,0 +12,0 @@ return new Attribute(this.key.eval ? this.key.eval(context) : this.key,

@@ -1,4 +0,4 @@

var Node = require("./node"),
Anonymous = require("./anonymous"),
FunctionCaller = require("../functions/function-caller");
var Node = require('./node'),
Anonymous = require('./anonymous'),
FunctionCaller = require('../functions/function-caller');
//

@@ -15,3 +15,3 @@ // A function call node.

Call.prototype = new Node();
Call.prototype.type = "Call";
Call.prototype.type = 'Call';
Call.prototype.accept = function (visitor) {

@@ -50,4 +50,4 @@ if (this.args) {

throw {
type: e.type || "Runtime",
message: "error evaluating function `" + this.name + "`" +
type: e.type || 'Runtime',
message: 'error evaluating function `' + this.name + '`' +
(e.message ? ': ' + e.message : ''),

@@ -83,3 +83,3 @@ index: this.getIndex(),

Call.prototype.genCSS = function (context, output) {
output.add(this.name + "(", this.fileInfo(), this.getIndex());
output.add(this.name + '(', this.fileInfo(), this.getIndex());

@@ -89,8 +89,8 @@ for (var i = 0; i < this.args.length; i++) {

if (i + 1 < this.args.length) {
output.add(", ");
output.add(', ');
}
}
output.add(")");
output.add(')');
};
module.exports = Call;

@@ -1,3 +0,3 @@

var Node = require("./node"),
colors = require("../data/colors");
var Node = require('./node'),
colors = require('../data/colors');

@@ -32,3 +32,3 @@ //

Color.prototype = new Node();
Color.prototype.type = "Color";
Color.prototype.type = 'Color';

@@ -76,6 +76,6 @@ function clamp(v, max) {

if (alpha < 1) {
return "rgba(" + this.rgb.map(function (c) {
return 'rgba(' + this.rgb.map(function (c) {
return clamp(Math.round(c), 255);
}).concat(clamp(alpha, 1))
.join(',' + (compress ? '' : ' ')) + ")";
.join(',' + (compress ? '' : ' ')) + ')';
}

@@ -182,3 +182,3 @@

}
else if (key === "transparent") {
else if (key === 'transparent') {
c = new Color([0, 0, 0], 0);

@@ -185,0 +185,0 @@ }

@@ -1,2 +0,2 @@

var Node = require("./node");
var Node = require('./node');

@@ -8,8 +8,8 @@ var Combinator = function (value) {

} else {
this.value = value ? value.trim() : "";
this.emptyOrWhitespace = this.value === "";
this.value = value ? value.trim() : '';
this.emptyOrWhitespace = this.value === '';
}
};
Combinator.prototype = new Node();
Combinator.prototype.type = "Combinator";
Combinator.prototype.type = 'Combinator';
var _noSpaceCombinators = {

@@ -16,0 +16,0 @@ '': true,

@@ -1,3 +0,3 @@

var Node = require("./node"),
getDebugInfo = require("./debug-info");
var Node = require('./node'),
getDebugInfo = require('./debug-info');

@@ -12,3 +12,3 @@ var Comment = function (value, isLineComment, index, currentFileInfo) {

Comment.prototype = new Node();
Comment.prototype.type = "Comment";
Comment.prototype.type = 'Comment';
Comment.prototype.genCSS = function (context, output) {

@@ -21,5 +21,5 @@ if (this.debugInfo) {

Comment.prototype.isSilent = function(context) {
var isCompressed = context.compress && this.value[2] !== "!";
var isCompressed = context.compress && this.value[2] !== '!';
return this.isLineComment || isCompressed;
};
module.exports = Comment;

@@ -1,2 +0,2 @@

var Node = require("./node");
var Node = require('./node');

@@ -11,3 +11,3 @@ var Condition = function (op, l, r, i, negate) {

Condition.prototype = new Node();
Condition.prototype.type = "Condition";
Condition.prototype.type = 'Condition';
Condition.prototype.accept = function (visitor) {

@@ -14,0 +14,0 @@ this.lvalue = visitor.visit(this.lvalue);

var debugInfo = function(context, ctx, lineSeparator) {
var result = "";
var result = '';
if (context.dumpLineNumbers && !context.compress) {

@@ -12,3 +12,3 @@ switch (context.dumpLineNumbers) {

case 'all':
result = debugInfo.asComment(ctx) + (lineSeparator || "") + debugInfo.asMediaQuery(ctx);
result = debugInfo.asComment(ctx) + (lineSeparator || '') + debugInfo.asMediaQuery(ctx);
break;

@@ -15,0 +15,0 @@ }

@@ -1,5 +0,5 @@

var Node = require("./node"),
Value = require("./value"),
Keyword = require("./keyword"),
Anonymous = require("./anonymous");
var Node = require('./node'),
Value = require('./value'),
Keyword = require('./keyword'),
Anonymous = require('./anonymous');

@@ -21,3 +21,3 @@ var Declaration = function (name, value, important, merge, index, currentFileInfo, inline, variable) {

function evalName(context, name) {
var value = "", i, n = name.length,
var value = '', i, n = name.length,
output = {add: function (s) {value += s;}};

@@ -31,3 +31,3 @@ for (i = 0; i < n; i++) {

Declaration.prototype = new Node();
Declaration.prototype.type = "Declaration";
Declaration.prototype.type = 'Declaration';
Declaration.prototype.genCSS = function (context, output) {

@@ -43,7 +43,7 @@ output.add(this.name + (context.compress ? ':' : ': '), this.fileInfo(), this.getIndex());

}
output.add(this.important + ((this.inline || (context.lastRule && context.compress)) ? "" : ";"), this._fileInfo, this._index);
output.add(this.important + ((this.inline || (context.lastRule && context.compress)) ? '' : ';'), this._fileInfo, this._index);
};
Declaration.prototype.eval = function (context) {
var strictMathBypass = false, name = this.name, evaldValue, variable = this.variable;
if (typeof name !== "string") {
if (typeof name !== 'string') {
// expand 'primitive' name directly to get

@@ -55,3 +55,3 @@ // things faster (~10% for benchmark.less):

}
if (name === "font" && !context.strictMath) {
if (name === 'font' && !context.strictMath) {
strictMathBypass = true;

@@ -64,4 +64,4 @@ context.strictMath = true;

if (!this.variable && evaldValue.type === "DetachedRuleset") {
throw { message: "Rulesets cannot be evaluated on a property.",
if (!this.variable && evaldValue.type === 'DetachedRuleset') {
throw { message: 'Rulesets cannot be evaluated on a property.',
index: this.getIndex(), filename: this.fileInfo().filename };

@@ -98,3 +98,3 @@ }

this.value,
"!important",
'!important',
this.merge,

@@ -101,0 +101,0 @@ this.getIndex(), this.fileInfo(), this.inline);

@@ -1,4 +0,4 @@

var Node = require("./node"),
contexts = require("../contexts"),
utils = require("../utils");
var Node = require('./node'),
contexts = require('../contexts'),
utils = require('../utils');

@@ -11,3 +11,3 @@ var DetachedRuleset = function (ruleset, frames) {

DetachedRuleset.prototype = new Node();
DetachedRuleset.prototype.type = "DetachedRuleset";
DetachedRuleset.prototype.type = 'DetachedRuleset';
DetachedRuleset.prototype.evalFirst = true;

@@ -14,0 +14,0 @@ DetachedRuleset.prototype.accept = function (visitor) {

@@ -1,5 +0,5 @@

var Node = require("./node"),
unitConversions = require("../data/unit-conversions"),
Unit = require("./unit"),
Color = require("./color");
var Node = require('./node'),
unitConversions = require('../data/unit-conversions'),
Unit = require('./unit'),
Color = require('./color');

@@ -12,3 +12,3 @@ //

if (isNaN(this.value)) {
throw new Error("Dimension is not a number.");
throw new Error('Dimension is not a number.');
}

@@ -21,3 +21,3 @@ this.unit = (unit && unit instanceof Unit) ? unit :

Dimension.prototype = new Node();
Dimension.prototype.type = "Dimension";
Dimension.prototype.type = 'Dimension';
Dimension.prototype.accept = function (visitor) {

@@ -34,3 +34,3 @@ this.unit = visitor.visit(this.unit);

if ((context && context.strictUnits) && !this.unit.isSingular()) {
throw new Error("Multiple units in dimension. Correct the units or use the unit function. Bad unit: " + this.unit.toString());
throw new Error('Multiple units in dimension. Correct the units or use the unit function. Bad unit: ' + this.unit.toString());
}

@@ -43,3 +43,3 @@

// would be output 1e-6 etc.
strValue = value.toFixed(20).replace(/0+$/, "");
strValue = value.toFixed(20).replace(/0+$/, '');
}

@@ -84,4 +84,4 @@

if (context.strictUnits && other.unit.toString() !== unit.toString()) {
throw new Error("Incompatible units. Change the units or use the unit function. Bad units: '" + unit.toString() +
"' and '" + other.unit.toString() + "'.");
throw new Error('Incompatible units. Change the units or use the unit function. Bad units: \'' + unit.toString() +
'\' and \'' + other.unit.toString() + '\'.');
}

@@ -88,0 +88,0 @@

@@ -1,4 +0,4 @@

var Node = require("./node"),
Paren = require("./paren"),
Combinator = require("./combinator");
var Node = require('./node'),
Paren = require('./paren'),
Combinator = require('./combinator');

@@ -14,3 +14,3 @@ var Element = function (combinator, value, index, currentFileInfo, visibilityInfo) {

} else {
this.value = "";
this.value = '';
}

@@ -23,7 +23,7 @@ this._index = index;

Element.prototype = new Node();
Element.prototype.type = "Element";
Element.prototype.type = 'Element';
Element.prototype.accept = function (visitor) {
var value = this.value;
this.combinator = visitor.visit(this.combinator);
if (typeof value === "object") {
if (typeof value === 'object') {
this.value = visitor.visit(value);

@@ -30,0 +30,0 @@ }

@@ -1,13 +0,14 @@

var Node = require("./node"),
Paren = require("./paren"),
Comment = require("./comment");
var Node = require('./node'),
Paren = require('./paren'),
Comment = require('./comment');
var Expression = function (value) {
var Expression = function (value, noSpacing) {
this.value = value;
this.noSpacing = noSpacing;
if (!value) {
throw new Error("Expression requires an array parameter");
throw new Error('Expression requires an array parameter');
}
};
Expression.prototype = new Node();
Expression.prototype.type = "Expression";
Expression.prototype.type = 'Expression';
Expression.prototype.accept = function (visitor) {

@@ -26,3 +27,3 @@ this.value = visitor.visitArray(this.value);

return e.eval(context);
}));
}), this.noSpacing);
} else if (this.value.length === 1) {

@@ -47,4 +48,4 @@ if (this.value[0].parens && !this.value[0].parensInOp) {

this.value[i].genCSS(context, output);
if (i + 1 < this.value.length) {
output.add(" ");
if (!this.noSpacing && i + 1 < this.value.length) {
output.add(' ');
}

@@ -51,0 +52,0 @@ }

@@ -1,3 +0,3 @@

var Node = require("./node"),
Selector = require("./selector");
var Node = require('./node'),
Selector = require('./selector');

@@ -15,3 +15,3 @@ var Extend = function Extend(selector, option, index, currentFileInfo, visibilityInfo) {

switch (option) {
case "all":
case 'all':
this.allowBefore = true;

@@ -30,3 +30,3 @@ this.allowAfter = true;

Extend.prototype = new Node();
Extend.prototype.type = "Extend";
Extend.prototype.type = 'Extend';
Extend.prototype.accept = function (visitor) {

@@ -51,3 +51,3 @@ this.selector = visitor.visit(this.selector);

// future TODO - move both logics into the selector joiner visitor
if (i > 0 && selectorElements.length && selectorElements[0].combinator.value === "") {
if (i > 0 && selectorElements.length && selectorElements[0].combinator.value === '') {
selectorElements[0].combinator.value = ' ';

@@ -54,0 +54,0 @@ }

@@ -1,9 +0,9 @@

var Node = require("./node"),
Media = require("./media"),
URL = require("./url"),
Quoted = require("./quoted"),
Ruleset = require("./ruleset"),
Anonymous = require("./anonymous"),
utils = require("../utils"),
LessError = require("../less-error");
var Node = require('./node'),
Media = require('./media'),
URL = require('./url'),
Quoted = require('./quoted'),
Ruleset = require('./ruleset'),
Anonymous = require('./anonymous'),
utils = require('../utils'),
LessError = require('../less-error');

@@ -53,3 +53,3 @@ //

Import.prototype = new Node();
Import.prototype.type = "Import";
Import.prototype.type = 'Import';
Import.prototype.accept = function (visitor) {

@@ -66,6 +66,6 @@ if (this.features) {

if (this.css && this.path._fileInfo.reference === undefined) {
output.add("@import ", this._fileInfo, this._index);
output.add('@import ', this._fileInfo, this._index);
this.path.genCSS(context, output);
if (this.features) {
output.add(" ");
output.add(' ');
this.features.genCSS(context, output);

@@ -141,3 +141,3 @@ }

catch (e) {
e.message = "Plugin error during evaluation";
e.message = 'Plugin error during evaluation';
throw new LessError(e, this.root.imports, this.root.filename);

@@ -155,3 +155,3 @@ }

if (this.skip) {
if (typeof this.skip === "function") {
if (typeof this.skip === 'function') {
this.skip = this.skip();

@@ -158,0 +158,0 @@ }

@@ -1,5 +0,5 @@

var JsEvalNode = require("./js-eval-node"),
Dimension = require("./dimension"),
Quoted = require("./quoted"),
Anonymous = require("./anonymous");
var JsEvalNode = require('./js-eval-node'),
Dimension = require('./dimension'),
Quoted = require('./quoted'),
Anonymous = require('./anonymous');

@@ -13,3 +13,3 @@ var JavaScript = function (string, escaped, index, currentFileInfo) {

JavaScript.prototype = new JsEvalNode();
JavaScript.prototype.type = "JavaScript";
JavaScript.prototype.type = 'JavaScript';
JavaScript.prototype.eval = function(context) {

@@ -16,0 +16,0 @@ var result = this.evaluateJavaScript(this.expression, context);

@@ -1,3 +0,3 @@

var Node = require("./node"),
Variable = require("./variable");
var Node = require('./node'),
Variable = require('./variable');

@@ -14,3 +14,3 @@ var JsEvalNode = function() {

if (!context.javascriptEnabled) {
throw { message: "Inline JavaScript is not enabled. Is it set in your options?",
throw { message: 'Inline JavaScript is not enabled. Is it set in your options?',
filename: this.fileInfo().filename,

@@ -27,3 +27,3 @@ index: this.getIndex() };

} catch (e) {
throw { message: "JavaScript evaluation error: " + e.message + " from `" + expression + "`" ,
throw { message: 'JavaScript evaluation error: ' + e.message + ' from `' + expression + '`' ,
filename: this.fileInfo().filename,

@@ -49,3 +49,3 @@ index: this.getIndex() };

} catch (e) {
throw { message: "JavaScript evaluation error: '" + e.name + ': ' + e.message.replace(/["]/g, "'") + "'" ,
throw { message: 'JavaScript evaluation error: \'' + e.name + ': ' + e.message.replace(/["]/g, '\'') + '\'' ,
filename: this.fileInfo().filename,

@@ -52,0 +52,0 @@ index: this.getIndex() };

@@ -1,8 +0,8 @@

var Node = require("./node");
var Node = require('./node');
var Keyword = function (value) { this.value = value; };
Keyword.prototype = new Node();
Keyword.prototype.type = "Keyword";
Keyword.prototype.type = 'Keyword';
Keyword.prototype.genCSS = function (context, output) {
if (this.value === '%') { throw { type: "Syntax", message: "Invalid % without number" }; }
if (this.value === '%') { throw { type: 'Syntax', message: 'Invalid % without number' }; }
output.add(this.value);

@@ -9,0 +9,0 @@ };

@@ -1,8 +0,8 @@

var Ruleset = require("./ruleset"),
Value = require("./value"),
Selector = require("./selector"),
Anonymous = require("./anonymous"),
Expression = require("./expression"),
AtRule = require("./atrule"),
utils = require("../utils");
var Ruleset = require('./ruleset'),
Value = require('./value'),
Selector = require('./selector'),
Anonymous = require('./anonymous'),
Expression = require('./expression'),
AtRule = require('./atrule'),
utils = require('../utils');

@@ -25,3 +25,3 @@ var Media = function (value, features, index, currentFileInfo, visibilityInfo) {

Media.prototype = new AtRule();
Media.prototype.type = "Media";
Media.prototype.type = 'Media';
Media.prototype.isRulesetLike = function() { return true; };

@@ -109,3 +109,3 @@ Media.prototype.accept = function (visitor) {

for (i = path.length - 1; i > 0; i--) {
path.splice(i, 0, new Anonymous("and"));
path.splice(i, 0, new Anonymous('and'));
}

@@ -112,0 +112,0 @@

@@ -1,5 +0,5 @@

var Node = require("./node"),
Selector = require("./selector"),
MixinDefinition = require("./mixin-definition"),
defaultFunc = require("../functions/default");
var Node = require('./node'),
Selector = require('./selector'),
MixinDefinition = require('./mixin-definition'),
defaultFunc = require('../functions/default');

@@ -16,3 +16,3 @@ var MixinCall = function (elements, args, index, currentFileInfo, important) {

MixinCall.prototype = new Node();
MixinCall.prototype.type = "MixinCall";
MixinCall.prototype.type = 'MixinCall';
MixinCall.prototype.accept = function (visitor) {

@@ -133,3 +133,3 @@ if (this.selector) {

originalRuleset = mixin.originalRuleset || mixin;
mixin = new MixinDefinition("", [], mixin.rules, null, false, null, originalRuleset.visibilityInfo());
mixin = new MixinDefinition('', [], mixin.rules, null, false, null, originalRuleset.visibilityInfo());
mixin.originalRuleset = originalRuleset;

@@ -157,3 +157,3 @@ }

throw { type: 'Name',
message: this.selector.toCSS().trim() + " is undefined",
message: this.selector.toCSS().trim() + ' is undefined',
index: this.getIndex(), filename: this.fileInfo().filename };

@@ -175,5 +175,5 @@ }

(args ? args.map(function (a) {
var argValue = "";
var argValue = '';
if (a.name) {
argValue += a.name + ":";
argValue += a.name + ':';
}

@@ -183,7 +183,7 @@ if (a.value.toCSS) {

} else {
argValue += "???";
argValue += '???';
}
return argValue;
}).join(', ') : "") + ")";
}).join(', ') : '') + ')';
};
module.exports = MixinCall;

@@ -1,8 +0,8 @@

var Selector = require("./selector"),
Element = require("./element"),
Ruleset = require("./ruleset"),
Declaration = require("./declaration"),
Expression = require("./expression"),
contexts = require("../contexts"),
utils = require("../utils");
var Selector = require('./selector'),
Element = require('./element'),
Ruleset = require('./ruleset'),
Declaration = require('./declaration'),
Expression = require('./expression'),
contexts = require('../contexts'),
utils = require('../utils');

@@ -34,3 +34,3 @@ var Definition = function (name, params, rules, condition, variadic, frames, visibilityInfo) {

Definition.prototype = new Ruleset();
Definition.prototype.type = "MixinDefinition";
Definition.prototype.type = 'MixinDefinition';
Definition.prototype.evalFirst = true;

@@ -79,3 +79,3 @@ Definition.prototype.accept = function (visitor) {

} else {
throw { type: 'Runtime', message: "Named argument for " + this.name +
throw { type: 'Runtime', message: 'Named argument for ' + this.name +
' ' + args[i].name + ' not found' };

@@ -107,3 +107,3 @@ }

} else {
throw { type: 'Runtime', message: "wrong number of arguments for " + this.name +
throw { type: 'Runtime', message: 'wrong number of arguments for ' + this.name +
' (' + argsLength + ' for ' + this.arity + ')' };

@@ -110,0 +110,0 @@ }

@@ -1,4 +0,4 @@

var Node = require("./node"),
Operation = require("./operation"),
Dimension = require("./dimension");
var Node = require('./node'),
Operation = require('./operation'),
Dimension = require('./dimension');

@@ -9,3 +9,3 @@ var Negative = function (node) {

Negative.prototype = new Node();
Negative.prototype.type = "Negative";
Negative.prototype.type = 'Negative';
Negative.prototype.genCSS = function (context, output) {

@@ -12,0 +12,0 @@ output.add('-');

@@ -9,6 +9,6 @@ var Node = function() {

var self = this;
Object.defineProperty(this, "currentFileInfo", {
Object.defineProperty(this, 'currentFileInfo', {
get: function() { return self.fileInfo(); }
});
Object.defineProperty(this, "index", {
Object.defineProperty(this, 'index', {
get: function() { return self.getIndex(); }

@@ -80,3 +80,3 @@ });

// of Quoted or Anonymous if either value is one of those
!(b.type === "Quoted" || b.type === "Anonymous")) {
!(b.type === 'Quoted' || b.type === 'Anonymous')) {
return a.compare(b);

@@ -83,0 +83,0 @@ } else if (b.compare) {

@@ -1,4 +0,4 @@

var Node = require("./node"),
Color = require("./color"),
Dimension = require("./dimension");
var Node = require('./node'),
Color = require('./color'),
Dimension = require('./dimension');

@@ -11,3 +11,3 @@ var Operation = function (op, operands, isSpaced) {

Operation.prototype = new Node();
Operation.prototype.type = "Operation";
Operation.prototype.type = 'Operation';
Operation.prototype.accept = function (visitor) {

@@ -28,4 +28,4 @@ this.operands = visitor.visit(this.operands);

if (!a.operate) {
throw { type: "Operation",
message: "Operation on an invalid type" };
throw { type: 'Operation',
message: 'Operation on an invalid type' };
}

@@ -41,7 +41,7 @@

if (this.isSpaced) {
output.add(" ");
output.add(' ');
}
output.add(this.op);
if (this.isSpaced) {
output.add(" ");
output.add(' ');
}

@@ -48,0 +48,0 @@ this.operands[1].genCSS(context, output);

@@ -1,2 +0,2 @@

var Node = require("./node");
var Node = require('./node');

@@ -7,3 +7,3 @@ var Paren = function (node) {

Paren.prototype = new Node();
Paren.prototype.type = "Paren";
Paren.prototype.type = 'Paren';
Paren.prototype.genCSS = function (context, output) {

@@ -10,0 +10,0 @@ output.add('(');

@@ -1,3 +0,3 @@

var Node = require("./node"),
Declaration = require("./declaration");
var Node = require('./node'),
Declaration = require('./declaration');

@@ -10,3 +10,3 @@ var Property = function (name, index, currentFileInfo) {

Property.prototype = new Node();
Property.prototype.type = "Property";
Property.prototype.type = 'Property';
Property.prototype.eval = function (context) {

@@ -19,3 +19,3 @@ var property, name = this.name;

throw { type: 'Name',
message: "Recursive property reference for " + name,
message: 'Recursive property reference for ' + name,
filename: this.fileInfo().filename,

@@ -60,3 +60,3 @@ index: this.getIndex() };

throw { type: 'Name',
message: "Property '" + name + "' is undefined",
message: 'Property \'' + name + '\' is undefined',
filename: this.currentFileInfo.filename,

@@ -63,0 +63,0 @@ index: this.index };

@@ -1,4 +0,4 @@

var Node = require("./node"),
Variable = require("./variable"),
Property = require("./property");
var Node = require('./node'),
Variable = require('./variable'),
Property = require('./property');

@@ -11,5 +11,7 @@ var Quoted = function (str, content, escaped, index, currentFileInfo) {

this._fileInfo = currentFileInfo;
this.variableRegex = /@\{([\w-]+)\}/g;
this.propRegex = /\$\{([\w-]+)\}/g;
};
Quoted.prototype = new Node();
Quoted.prototype.type = "Quoted";
Quoted.prototype.type = 'Quoted';
Quoted.prototype.genCSS = function (context, output) {

@@ -25,3 +27,3 @@ if (!this.escaped) {

Quoted.prototype.containsVariables = function() {
return this.value.match(/@\{([\w-]+)\}/);
return this.value.match(this.variableRegex);
};

@@ -46,4 +48,4 @@ Quoted.prototype.eval = function (context) {

}
value = iterativeReplace(value, /@\{([\w-]+)\}/g, variableReplacement);
value = iterativeReplace(value, /\$\{([\w-]+)\}/g, propertyReplacement);
value = iterativeReplace(value, this.variableRegex, variableReplacement);
value = iterativeReplace(value, this.propRegex, propertyReplacement);
return new Quoted(this.quote + value + this.quote, value, this.escaped, this.getIndex(), this.fileInfo());

@@ -53,3 +55,3 @@ };

// when comparing quoted strings allow the quote to differ
if (other.type === "Quoted" && !this.escaped && !other.escaped) {
if (other.type === 'Quoted' && !this.escaped && !other.escaped) {
return Node.numericCompare(this.value, other.value);

@@ -56,0 +58,0 @@ } else {

@@ -1,14 +0,14 @@

var Node = require("./node"),
Declaration = require("./declaration"),
Keyword = require("./keyword"),
Comment = require("./comment"),
Paren = require("./paren"),
Selector = require("./selector"),
Element = require("./element"),
Anonymous = require("./anonymous"),
contexts = require("../contexts"),
globalFunctionRegistry = require("../functions/function-registry"),
defaultFunc = require("../functions/default"),
getDebugInfo = require("./debug-info"),
utils = require("../utils");
var Node = require('./node'),
Declaration = require('./declaration'),
Keyword = require('./keyword'),
Comment = require('./comment'),
Paren = require('./paren'),
Selector = require('./selector'),
Element = require('./element'),
Anonymous = require('./anonymous'),
contexts = require('../contexts'),
globalFunctionRegistry = require('../functions/function-registry'),
defaultFunc = require('../functions/default'),
getDebugInfo = require('./debug-info'),
utils = require('../utils');

@@ -30,3 +30,3 @@ var Ruleset = function (selectors, rules, strictImports, visibilityInfo) {

Ruleset.prototype = new Node();
Ruleset.prototype.type = "Ruleset";
Ruleset.prototype.type = 'Ruleset';
Ruleset.prototype.isRuleset = true;

@@ -51,4 +51,4 @@ Ruleset.prototype.isRulesetLike = function() { return true; };

defaultFunc.error({
type: "Syntax",
message: "it is currently only allowed in parametric mixin guards,"
type: 'Syntax',
message: 'it is currently only allowed in parametric mixin guards,'
});

@@ -126,3 +126,3 @@ for (i = 0; i < selCnt; i++) {

for (i = 0; (rule = rsRules[i]); i++) {
if (rule.type === "MixinCall") {
if (rule.type === 'MixinCall') {
/* jshint loopfunc:true */

@@ -141,3 +141,3 @@ rules = rule.eval(context).filter(function(r) {

ruleset.resetCache();
} else if (rule.type === "VariableCall") {
} else if (rule.type === 'VariableCall') {
/* jshint loopfunc:true */

@@ -201,3 +201,3 @@ rules = rule.eval(context).rules.filter(function(r) {

for (i = 0; i < rules.length; i++) {
if (rules[i].type === "Import") {
if (rules[i].type === 'Import') {
importRules = rules[i].eval(context);

@@ -257,3 +257,3 @@ if (importRules && (importRules.length || importRules.length === 0)) {

// guard against root being a string (in the case of inlined less)
if (r.type === "Import" && r.root && r.root.variables) {
if (r.type === 'Import' && r.root && r.root.variables) {
var vars = r.root.variables();

@@ -306,17 +306,21 @@ for (var name in vars) {

if (decl.value instanceof Anonymous && !decl.parsed) {
this.parse.parseNode(
decl.value.value,
["value", "important"],
decl.value.getIndex(),
decl.fileInfo(),
function(err, result) {
if (err) {
decl.parsed = true;
}
if (result) {
decl.value = result[0];
decl.important = result[1] || '';
decl.parsed = true;
}
});
if (typeof decl.value.value === 'string') {
this.parse.parseNode(
decl.value.value,
['value', 'important'],
decl.value.getIndex(),
decl.fileInfo(),
function(err, result) {
if (err) {
decl.parsed = true;
}
if (result) {
decl.value = result[0];
decl.important = result[1] || '';
decl.parsed = true;
}
});
} else {
decl.parsed = true;
}

@@ -408,4 +412,4 @@ return decl;

var tabRuleStr = context.compress ? '' : Array(context.tabLevel + 1).join(" "),
tabSetStr = context.compress ? '' : Array(context.tabLevel).join(" "),
var tabRuleStr = context.compress ? '' : Array(context.tabLevel + 1).join(' '),
tabSetStr = context.compress ? '' : Array(context.tabLevel).join(' '),
sep;

@@ -425,3 +429,3 @@

importNodeIndex++;
} else if (rule.type === "Import") {
} else if (rule.type === 'Import') {
ruleNodes.splice(importNodeIndex, 0, rule);

@@ -656,3 +660,3 @@ importNodeIndex++;

// non parent reference elements just get added
if (el.value !== "&") {
if (el.value !== '&') {
var nestedSelector = findNestedSelector(el);

@@ -659,0 +663,0 @@ if (nestedSelector != null) {

@@ -1,4 +0,4 @@

var Node = require("./node"),
Element = require("./element"),
LessError = require("../less-error");
var Node = require('./node'),
Element = require('./element'),
LessError = require('../less-error');

@@ -17,3 +17,3 @@ var Selector = function (elements, extendList, condition, index, currentFileInfo, visibilityInfo) {

Selector.prototype = new Node();
Selector.prototype.type = "Selector";
Selector.prototype.type = 'Selector';
Selector.prototype.accept = function (visitor) {

@@ -39,6 +39,6 @@ if (this.elements) {

Selector.prototype.getElements = function(els) {
if (typeof els === "string") {
if (typeof els === 'string') {
this.parse.parseNode(
els,
["selector"],
['selector'],
this._index,

@@ -90,6 +90,6 @@ this._fileInfo,

return v.combinator.value + (v.value.value || v.value);
}).join("").match(/[,&#\*\.\w-]([\w-]|(\\.))*/g);
}).join('').match(/[,&#\*\.\w-]([\w-]|(\\.))*/g);
if (elements) {
if (elements[0] === "&") {
if (elements[0] === '&') {
elements.shift();

@@ -120,3 +120,3 @@ }

var i, element;
if ((!context || !context.firstSelector) && this.elements[0].combinator.value === "") {
if ((!context || !context.firstSelector) && this.elements[0].combinator.value === '') {
output.add(' ', this.fileInfo(), this.getIndex());

@@ -123,0 +123,0 @@ }

@@ -1,2 +0,2 @@

var Node = require("./node");
var Node = require('./node');

@@ -7,4 +7,4 @@ var UnicodeDescriptor = function (value) {

UnicodeDescriptor.prototype = new Node();
UnicodeDescriptor.prototype.type = "UnicodeDescriptor";
UnicodeDescriptor.prototype.type = 'UnicodeDescriptor';
module.exports = UnicodeDescriptor;

@@ -1,4 +0,4 @@

var Node = require("./node"),
unitConversions = require("../data/unit-conversions"),
utils = require("../utils");
var Node = require('./node'),
unitConversions = require('../data/unit-conversions'),
utils = require('../utils');

@@ -16,3 +16,3 @@ var Unit = function (numerator, denominator, backupUnit) {

Unit.prototype = new Node();
Unit.prototype.type = "Unit";
Unit.prototype.type = 'Unit';
Unit.prototype.clone = function () {

@@ -33,5 +33,5 @@ return new Unit(utils.copyArray(this.numerator), utils.copyArray(this.denominator), this.backupUnit);

Unit.prototype.toString = function () {
var i, returnStr = this.numerator.join("*");
var i, returnStr = this.numerator.join('*');
for (i = 0; i < this.denominator.length; i++) {
returnStr += "/" + this.denominator[i];
returnStr += '/' + this.denominator[i];
}

@@ -38,0 +38,0 @@ return returnStr;

@@ -1,2 +0,2 @@

var Node = require("./node");
var Node = require('./node');

@@ -10,3 +10,3 @@ var URL = function (val, index, currentFileInfo, isEvald) {

URL.prototype = new Node();
URL.prototype.type = "Url";
URL.prototype.type = 'Url';
URL.prototype.accept = function (visitor) {

@@ -16,5 +16,5 @@ this.value = visitor.visit(this.value);

URL.prototype.genCSS = function (context, output) {
output.add("url(");
output.add('url(');
this.value.genCSS(context, output);
output.add(")");
output.add(')');
};

@@ -29,7 +29,7 @@ URL.prototype.eval = function (context) {

if (rootpath &&
typeof val.value === "string" &&
typeof val.value === 'string' &&
context.isPathRelative(val.value)) {
if (!val.quote) {
rootpath = rootpath.replace(/[\(\)'"\s]/g, function(match) { return "\\" + match; });
rootpath = rootpath.replace(/[\(\)'"\s]/g, function(match) { return '\\' + match; });
}

@@ -36,0 +36,0 @@ val.value = rootpath + val.value;

@@ -1,6 +0,6 @@

var Node = require("./node");
var Node = require('./node');
var Value = function (value) {
if (!value) {
throw new Error("Value requires an array argument");
throw new Error('Value requires an array argument');
}

@@ -15,3 +15,3 @@ if (!Array.isArray(value)) {

Value.prototype = new Node();
Value.prototype.type = "Value";
Value.prototype.type = 'Value';
Value.prototype.accept = function (visitor) {

@@ -18,0 +18,0 @@ if (this.value) {

@@ -1,3 +0,3 @@

var Node = require("./node"),
Variable = require("./variable");
var Node = require('./node'),
Variable = require('./variable');

@@ -9,3 +9,3 @@ var VariableCall = function (variable) {

VariableCall.prototype = new Node();
VariableCall.prototype.type = "VariableCall";
VariableCall.prototype.type = 'VariableCall';
VariableCall.prototype.eval = function (context) {

@@ -12,0 +12,0 @@ var detachedRuleset = new Variable(this.variable).eval(context);

@@ -1,2 +0,2 @@

var Node = require("./node");
var Node = require('./node');

@@ -9,3 +9,3 @@ var Variable = function (name, index, currentFileInfo) {

Variable.prototype = new Node();
Variable.prototype.type = "Variable";
Variable.prototype.type = 'Variable';
Variable.prototype.eval = function (context) {

@@ -20,3 +20,3 @@ var variable, name = this.name;

throw { type: 'Name',
message: "Recursive variable definition for " + name,
message: 'Recursive variable definition for ' + name,
filename: this.fileInfo().filename,

@@ -43,3 +43,3 @@ index: this.getIndex() };

throw { type: 'Name',
message: "variable " + name + " is undefined",
message: 'variable ' + name + ' is undefined',
filename: this.fileInfo().filename,

@@ -46,0 +46,0 @@ index: this.getIndex() };

@@ -13,3 +13,3 @@ /* jshint proto: true */

if (typeof index === 'number') {
line = (inputStream.slice(0, index).match(/\n/g) || "").length;
line = (inputStream.slice(0, index).match(/\n/g) || '').length;
}

@@ -16,0 +16,0 @@

@@ -1,5 +0,5 @@

var tree = require("../tree"),
Visitor = require("./visitor"),
logger = require("../logger"),
utils = require("../utils");
var tree = require('../tree'),
Visitor = require('./visitor'),
logger = require('../logger'),
utils = require('../utils');

@@ -113,3 +113,3 @@ /* jshint loopfunc:true */

}).forEach(function(extend) {
var selector = "_unknown_";
var selector = '_unknown_';
try {

@@ -122,3 +122,3 @@ selector = extend.selector.toCSS({});

indices[extend.index + ' ' + selector] = true;
logger.warn("extend '" + selector + "' has no matches");
logger.warn('extend \'' + selector + '\' has no matches');
}

@@ -182,3 +182,3 @@ });

//remember its parents for circular references
// remember its parents for circular references
newExtend.parent_ids = newExtend.parent_ids.concat(targetExtend.parent_ids, extend.parent_ids);

@@ -203,4 +203,4 @@

if (iterationCount > 100) {
var selectorOne = "{unable to calculate}";
var selectorTwo = "{unable to calculate}";
var selectorOne = '{unable to calculate}';
var selectorTwo = '{unable to calculate}';
try {

@@ -211,4 +211,4 @@ selectorOne = extendsToAdd[0].selfSelectors[0].toCSS();

catch (e) {}
throw { message: "extend circular reference detected. One of the circular extends is currently:" +
selectorOne + ":extend(" + selectorTwo + ")"};
throw { message: 'extend circular reference detected. One of the circular extends is currently:' +
selectorOne + ':extend(' + selectorTwo + ')'};
}

@@ -337,3 +337,3 @@

isElementValuesEqual: function(elementValue1, elementValue2) {
if (typeof elementValue1 === "string" || typeof elementValue2 === "string") {
if (typeof elementValue1 === 'string' || typeof elementValue2 === 'string') {
return elementValue1 === elementValue2;

@@ -340,0 +340,0 @@ }

@@ -1,5 +0,5 @@

var contexts = require("../contexts"),
Visitor = require("./visitor"),
ImportSequencer = require("./import-sequencer"),
utils = require("../utils");
var contexts = require('../contexts'),
Visitor = require('./visitor'),
ImportSequencer = require('./import-sequencer'),
utils = require('../utils');

@@ -154,3 +154,3 @@ var ImportVisitor = function(importer, finish) {

visitDeclaration: function (declNode, visitArgs) {
if (declNode.value.type === "DetachedRuleset") {
if (declNode.value.type === 'DetachedRuleset') {
this.context.frames.unshift(declNode);

@@ -162,3 +162,3 @@ } else {

visitDeclarationOut: function(declNode) {
if (declNode.value.type === "DetachedRuleset") {
if (declNode.value.type === 'DetachedRuleset') {
this.context.frames.shift();

@@ -165,0 +165,0 @@ }

var visitors = {
Visitor: require("./visitor"),
Visitor: require('./visitor'),
ImportVisitor: require('./import-visitor'),
MarkVisibleSelectorsVisitor: require("./set-tree-visibility-visitor"),
MarkVisibleSelectorsVisitor: require('./set-tree-visibility-visitor'),
ExtendVisitor: require('./extend-visitor'),

@@ -6,0 +6,0 @@ JoinSelectorVisitor: require('./join-selector-visitor'),

@@ -1,2 +0,2 @@

var Visitor = require("./visitor");
var Visitor = require('./visitor');

@@ -3,0 +3,0 @@ var JoinSelectorVisitor = function() {

@@ -1,3 +0,3 @@

var tree = require("../tree"),
Visitor = require("./visitor");
var tree = require('../tree'),
Visitor = require('./visitor');

@@ -183,3 +183,3 @@ var CSSVisitorUtils = function(context) {

if (atRuleNode.name === "@charset") {
if (atRuleNode.name === '@charset') {
// Only output the debug info together with subsequent @charset definitions

@@ -190,3 +190,3 @@ // a comment (or @media statement) before the actual @charset atrule would

if (atRuleNode.debugInfo) {
var comment = new tree.Comment("/* " + atRuleNode.toCSS(this._context).replace(/\n/g, "") + " */\n");
var comment = new tree.Comment('/* ' + atRuleNode.toCSS(this._context).replace(/\n/g, '') + ' */\n');
comment.debugInfo = atRuleNode.debugInfo;

@@ -211,11 +211,11 @@ return this._visitor.visit(comment);

if (isRoot && ruleNode instanceof tree.Declaration && !ruleNode.variable) {
throw { message: "Properties must be inside selector blocks. They cannot be in the root",
throw { message: 'Properties must be inside selector blocks. They cannot be in the root',
index: ruleNode.getIndex(), filename: ruleNode.fileInfo() && ruleNode.fileInfo().filename};
}
if (ruleNode instanceof tree.Call) {
throw { message: "Function '" + ruleNode.name + "' is undefined",
throw { message: 'Function \'' + ruleNode.name + '\' is undefined',
index: ruleNode.getIndex(), filename: ruleNode.fileInfo() && ruleNode.fileInfo().filename};
}
if (ruleNode.type && !ruleNode.allowRoot) {
throw { message: ruleNode.type + " node returned by a function is not valid here",
throw { message: ruleNode.type + ' node returned by a function is not valid here',
index: ruleNode.getIndex(), filename: ruleNode.fileInfo() && ruleNode.fileInfo().filename};

@@ -222,0 +222,0 @@ }

@@ -1,2 +0,2 @@

var tree = require("../tree");
var tree = require('../tree');

@@ -17,3 +17,3 @@ var _visitArgs = { visitDeeper: true },

switch (typeof child) {
case "function":
case 'function':
// ignore bound functions directly on tree which do not have a prototype

@@ -25,3 +25,3 @@ // or aren't nodes

break;
case "object":
case 'object':
ticker = indexNodeTypes(child, ticker);

@@ -68,5 +68,5 @@ break;

if (!func) {
fnName = "visit" + node.type;
fnName = 'visit' + node.type;
func = impl[fnName] || _noop;
funcOut = impl[fnName + "Out"] || _noop;
funcOut = impl[fnName + 'Out'] || _noop;
visitFnCache[aryIndx] = func;

@@ -73,0 +73,0 @@ visitFnCache[outAryIndex] = funcOut;

{
"name": "less",
"version": "3.0.4",
"version": "3.5.0-beta",
"description": "Leaner CSS",

@@ -40,3 +40,4 @@ "homepage": "http://lesscss.org",

"scripts": {
"test": "grunt test"
"test": "grunt test",
"grunt": "grunt"
},

@@ -58,2 +59,3 @@ "optionalDependencies": {

"grunt-browserify": "^5.0.0",
"grunt-cli": "^1.2.0",
"grunt-contrib-clean": "^1.0.0",

@@ -60,0 +62,0 @@ "grunt-contrib-concat": "^1.0.1",

@@ -114,3 +114,3 @@ /* Add js reporter for sauce */

} catch (e) {
throw new Error("Couldn't reassign styleSheet.cssText.");
throw new Error('Couldn\'t reassign styleSheet.cssText.');
}

@@ -123,5 +123,5 @@ var transformedText = styleNode.styleSheet ? styleNode.styleSheet.cssText : styleNode.innerText;

testSheet = function (sheet) {
it(sheet.id + " should match the expected output", function (done) {
var lessOutputId = sheet.id.replace("original-", ""),
expectedOutputId = "expected-" + lessOutputId,
it(sheet.id + ' should match the expected output', function (done) {
var lessOutputId = sheet.id.replace('original-', ''),
expectedOutputId = 'expected-' + lessOutputId,
lessOutputObj,

@@ -141,4 +141,4 @@ lessOutput,

.then(function (text) {
if (window.navigator.userAgent.indexOf("MSIE") >= 0 ||
window.navigator.userAgent.indexOf("Trident/") >= 0) {
if (window.navigator.userAgent.indexOf('MSIE') >= 0 ||
window.navigator.userAgent.indexOf('Trident/') >= 0) {
text = ieFormat(text);

@@ -175,6 +175,6 @@ }

testErrorSheet = function (sheet) {
it(sheet.id + " should match an error", function (done) {
it(sheet.id + ' should match an error', function (done) {
var lessHref = sheet.href,
id = "less-error-message:" + extractId(lessHref),
errorHref = lessHref.replace(/.less$/, ".txt"),
id = 'less-error-message:' + extractId(lessHref),
errorHref = lessHref.replace(/.less$/, '.txt'),
errorFile = loadFile(errorHref),

@@ -190,17 +190,17 @@ actualErrorElement,

var innerText = (actualErrorElement.innerHTML
.replace(/<h3>|<\/?p>|<a href="[^"]*">|<\/a>|<ul>|<\/?pre( class="?[^">]*"?)?>|<\/li>|<\/?label>/ig, "")
.replace(/<\/h3>/ig, " ")
.replace(/<li>|<\/ul>|<br>/ig, "\n"))
.replace(/&amp;/ig, "&")
.replace(/<h3>|<\/?p>|<a href="[^"]*">|<\/a>|<ul>|<\/?pre( class="?[^">]*"?)?>|<\/li>|<\/?label>/ig, '')
.replace(/<\/h3>/ig, ' ')
.replace(/<li>|<\/ul>|<br>/ig, '\n'))
.replace(/&amp;/ig, '&')
// for IE8
.replace(/\r\n/g, "\n")
.replace(/\. \nin/, ". in");
.replace(/\r\n/g, '\n')
.replace(/\. \nin/, '. in');
actualErrorMsg = innerText
.replace(/\n\d+/g, function (lineNo) {
return lineNo + " ";
return lineNo + ' ';
})
.replace(/\n\s*in /g, " in ")
.replace(/\n{2,}/g, "\n")
.replace(/\nStack Trace\n[\s\S]*/i, "")
.replace(/\n$/, "")
.replace(/\n\s*in /g, ' in ')
.replace(/\n{2,}/g, '\n')
.replace(/\nStack Trace\n[\s\S]*/i, '')
.replace(/\n$/, '')
.trim();

@@ -210,12 +210,12 @@ errorFile

errorTxt = errorTxt
.replace(/\{path\}/g, "")
.replace(/\{pathrel\}/g, "")
.replace(/\{pathhref\}/g, "http://localhost:8081/test/less/errors/")
.replace(/\{404status\}/g, " (404)")
.replace(/\{node\}[\s\S]*\{\/node\}/g, "")
.replace(/\n$/, "")
.replace(/\{path\}/g, '')
.replace(/\{pathrel\}/g, '')
.replace(/\{pathhref\}/g, 'http://localhost:8081/test/less/errors/')
.replace(/\{404status\}/g, ' (404)')
.replace(/\{node\}[\s\S]*\{\/node\}/g, '')
.replace(/\n$/, '')
.trim();
expect(actualErrorMsg).toEqual(errorTxt);
if (errorTxt == actualErrorMsg) {
actualErrorElement.style.display = "none";
actualErrorElement.style.display = 'none';
}

@@ -229,12 +229,12 @@ done();

testErrorSheetConsole = function (sheet) {
it(sheet.id + " should match an error", function (done) {
it(sheet.id + ' should match an error', function (done) {
var lessHref = sheet.href,
id = sheet.id.replace(/^original-less:/, "less-error-message:"),
errorHref = lessHref.replace(/.less$/, ".txt"),
id = sheet.id.replace(/^original-less:/, 'less-error-message:'),
errorHref = lessHref.replace(/.less$/, '.txt'),
errorFile = loadFile(errorHref),
actualErrorElement = document.getElementById(id),
actualErrorMsg = logMessages[logMessages.length - 1]
.replace(/\nStack Trace\n[\s\S]*/, "");
.replace(/\nStack Trace\n[\s\S]*/, '');
describe("the error", function () {
describe('the error', function () {
expect(actualErrorElement).toBe(null);

@@ -246,7 +246,7 @@ });

errorTxt
.replace(/\{path\}/g, "")
.replace(/\{pathrel\}/g, "")
.replace(/\{pathhref\}/g, "http://localhost:8081/browser/less/")
.replace(/\{404status\}/g, " (404)")
.replace(/\{node\}.*\{\/node\}/g, "")
.replace(/\{path\}/g, '')
.replace(/\{pathrel\}/g, '')
.replace(/\{pathhref\}/g, 'http://localhost:8081/browser/less/')
.replace(/\{404status\}/g, ' (404)')
.replace(/\{node\}.*\{\/node\}/g, '')
.trim();

@@ -265,3 +265,3 @@ expect(actualErrorMsg).toEqual(errorTxt);

if (request.readyState == 4) {
resolve(request.responseText.replace(/\r/g, ""));
resolve(request.responseText.replace(/\r/g, ''));
}

@@ -268,0 +268,0 @@ };

var less = {
logLevel: 4,
errorReporting: "console",
errorReporting: 'console',
javascriptEnabled: true,

@@ -19,3 +19,3 @@ strictMath: false

// IE 8-10 does not support less in style tags
if (window.navigator.userAgent.indexOf("MSIE") >= 0) {
if (window.navigator.userAgent.indexOf('MSIE') >= 0) {
testFiles.length = 0;

@@ -22,0 +22,0 @@ }

@@ -1,5 +0,5 @@

describe("less.js browser behaviour", function() {
describe('less.js browser behaviour', function() {
testLessEqualsInDocument();
it("has some log messages", function() {
it('has some log messages', function() {
expect(logMessages.length).toBeGreaterThan(0);

@@ -6,0 +6,0 @@ });

less.errorReporting = 'console';
describe("less.js error reporting console test", function() {
describe('less.js error reporting console test', function() {
testLessErrorsInDocument(true);
});

@@ -1,3 +0,3 @@

describe("less.js error tests", function() {
describe('less.js error tests', function() {
testLessErrorsInDocument();
});
var less = {
logLevel: 4,
errorReporting: "console",
errorReporting: 'console',
plugins: [AddFilePlugin]
};

@@ -1,3 +0,3 @@

describe("less.js filemanager Plugin", function() {
describe('less.js filemanager Plugin', function() {
testLessEqualsInDocument();
});
var less = {
logLevel: 4,
errorReporting: "console",
errorReporting: 'console',
globalVars: {
"@global-var": "red"
'@global-var': 'red'
}
};

@@ -1,3 +0,3 @@

describe("less.js global vars", function() {
describe('less.js global vars', function() {
testLessEqualsInDocument();
});
var less = {
logLevel: 4,
errorReporting: "console",
errorReporting: 'console',
strictMath: false,
strictUnits: false
};

@@ -1,3 +0,3 @@

describe("less.js legacy tests", function() {
describe('less.js legacy tests', function() {
testLessEqualsInDocument();
});
var less = {
logLevel: 4,
errorReporting: "console"
errorReporting: 'console'
};

@@ -13,6 +13,6 @@ less.functions = {

_color: function(str) {
if (str.value === "evil red") {
return new(less.tree.Color)("600");
if (str.value === 'evil red') {
return new(less.tree.Color)('600');
}
}
};

@@ -1,7 +0,7 @@

console.warn("start spec");
describe("less.js main tests", function() {
console.warn('start spec');
describe('less.js main tests', function() {
testLessEqualsInDocument();
it("the global environment", function() {
it('the global environment', function() {
expect(window.require).toBe(undefined);
});
});
/* exported less */
var less = {
logLevel: 4,
errorReporting: "console"
errorReporting: 'console'
};
var alreadyRun = false;
describe("less.js modify vars", function () {
describe('less.js modify vars', function () {
beforeEach(function (done) {

@@ -16,4 +16,4 @@ // simulating "setUp" or "beforeAll" method

less.modifyVars({
var1: "green",
var2: "purple",
var1: 'green',
var2: 'purple',
scale: 20

@@ -27,3 +27,3 @@ }).then(function () {

testLessEqualsInDocument();
it("Should log only 2 XHR requests", function (done) {
it('Should log only 2 XHR requests', function (done) {
var xhrLogMessages = logMessages.filter(function (item) {

@@ -30,0 +30,0 @@ return (/XHR: Getting '/).test(item);

@@ -1,3 +0,3 @@

describe("less.js javascript disabled error tests", function() {
describe('less.js javascript disabled error tests', function() {
testLessErrorsInDocument();
});
var less = {logLevel: 4,
errorReporting: "console",
errorReporting: 'console',
plugins: [postProcessorPlugin]};

@@ -1,3 +0,3 @@

describe("less.js postProcessor Plugin", function() {
describe('less.js postProcessor Plugin', function() {
testLessEqualsInDocument();
});
var less = {logLevel: 4,
errorReporting: "console",
errorReporting: 'console',
plugins: [preProcessorPlugin]};

@@ -1,3 +0,3 @@

describe("less.js preProcessor Plugin", function() {
describe('less.js preProcessor Plugin', function() {
testLessEqualsInDocument();
});
var less = {logLevel: 1,
errorReporting: "console"};
less.env = "production";
errorReporting: 'console'};
less.env = 'production';

@@ -1,5 +0,5 @@

describe("less.js production behaviour", function() {
it("doesn't log any messages", function() {
describe('less.js production behaviour', function() {
it('doesn\'t log any messages', function() {
expect(logMessages.length).toEqual(0);
});
});
var less = {logLevel: 4,
errorReporting: "console"};
errorReporting: 'console'};
less.relativeUrls = true;

@@ -1,3 +0,3 @@

describe("less.js browser test - relative url's", function() {
describe('less.js browser test - relative url\'s', function() {
testLessEqualsInDocument();
});
var less = {logLevel: 4,
errorReporting: "console"};
less.rootpath = "https://localhost/";
errorReporting: 'console'};
less.rootpath = 'https://localhost/';
var less = {logLevel: 4,
errorReporting: "console"};
less.rootpath = "https://www.github.com/cloudhead/less.js/";
errorReporting: 'console'};
less.rootpath = 'https://www.github.com/cloudhead/less.js/';
less.relativeUrls = true;

@@ -1,3 +0,3 @@

describe("less.js browser test - rootpath and relative url's", function() {
describe('less.js browser test - rootpath and relative url\'s', function() {
testLessEqualsInDocument();
});

@@ -1,3 +0,3 @@

describe("less.js browser test - rootpath url's", function() {
describe('less.js browser test - rootpath url\'s', function() {
testLessEqualsInDocument();
});
var less = {
logLevel: 4,
errorReporting: "console",
errorReporting: 'console',
strictMath: true,
strictUnits: true };

@@ -1,3 +0,3 @@

describe("less.js strict units tests", function() {
describe('less.js strict units tests', function() {
testLessEqualsInDocument();
});
var less = {logLevel: 4,
errorReporting: "console",
errorReporting: 'console',
plugins: [VisitorPlugin]};

@@ -1,3 +0,3 @@

describe("less.js Visitor Plugin", function() {
describe('less.js Visitor Plugin', function() {
testLessEqualsInDocument();
});

@@ -1,7 +0,7 @@

var lessTest = require("./less-test"),
var lessTest = require('./less-test'),
lessTester = lessTest(),
path = require("path"),
path = require('path'),
stylize = require('../lib/less-node/lessc-helper').stylize;
console.log("\n" + stylize("Less", 'underline') + "\n");
console.log('\n' + stylize('Less', 'underline') + '\n');

@@ -21,21 +21,21 @@ lessTester.prepBomTest();

ieCompat: true
}, "strict-math/"],
[{strictMath: true, strictUnits: true, javascriptEnabled: true}, "errors/",
}, 'strict-math/'],
[{strictMath: true, strictUnits: true, javascriptEnabled: true}, 'errors/',
lessTester.testErrors, null],
[{strictMath: true, strictUnits: true, javascriptEnabled: false}, "no-js-errors/",
[{strictMath: true, strictUnits: true, javascriptEnabled: false}, 'no-js-errors/',
lessTester.testErrors, null],
[{strictMath: true, dumpLineNumbers: 'comments'}, "debug/", null,
[{strictMath: true, dumpLineNumbers: 'comments'}, 'debug/', null,
function(name) { return name + '-comments'; }],
[{strictMath: true, dumpLineNumbers: 'mediaquery'}, "debug/", null,
[{strictMath: true, dumpLineNumbers: 'mediaquery'}, 'debug/', null,
function(name) { return name + '-mediaquery'; }],
[{strictMath: true, dumpLineNumbers: 'all'}, "debug/", null,
[{strictMath: true, dumpLineNumbers: 'all'}, 'debug/', null,
function(name) { return name + '-all'; }],
[{strictMath: true, relativeUrls: false, rootpath: "folder (1)/"}, "static-urls/"],
[{strictMath: true, compress: true}, "compression/"],
[{strictMath: false, strictUnits: true}, "strict-units/"],
[{}, "legacy/"],
[{strictMath: true, strictUnits: true, sourceMap: true, globalVars: true }, "sourcemaps/",
[{strictMath: true, relativeUrls: false, rootpath: 'folder (1)/'}, 'static-urls/'],
[{strictMath: true, compress: true}, 'compression/'],
[{strictMath: false, strictUnits: true}, 'strict-units/'],
[{}, 'legacy/'],
[{strictMath: true, strictUnits: true, sourceMap: true, globalVars: true }, 'sourcemaps/',
lessTester.testSourcemap, null, null,
function(filename, type, baseFolder) {
if (type === "vars") {
if (type === 'vars') {
return path.join(baseFolder, filename) + '.json';

@@ -46,15 +46,15 @@ }

[{strictMath: true, strictUnits: true, sourceMap: {sourceMapFileInline: true}},
"sourcemaps-empty/", lessTester.testEmptySourcemap],
[{globalVars: true, banner: "/**\n * Test\n */\n"}, "globalVars/",
'sourcemaps-empty/', lessTester.testEmptySourcemap],
[{globalVars: true, banner: '/**\n * Test\n */\n'}, 'globalVars/',
null, null, null, function(name, type, baseFolder) { return path.join(baseFolder, name) + '.json'; }],
[{modifyVars: true}, "modifyVars/",
[{modifyVars: true}, 'modifyVars/',
null, null, null, function(name, type, baseFolder) { return path.join(baseFolder, name) + '.json'; }],
[{urlArgs: '424242'}, "url-args/"],
[{paths: ['test/data/', 'test/less/import/']}, "include-path/"],
[{paths: 'test/data/'}, "include-path-string/"],
[{plugin: 'test/plugins/postprocess/'}, "postProcessorPlugin/"],
[{plugin: 'test/plugins/preprocess/'}, "preProcessorPlugin/"],
[{plugin: 'test/plugins/visitor/'}, "visitorPlugin/"],
[{plugin: 'test/plugins/filemanager/'}, "filemanagerPlugin/"],
[{}, "no-strict-math/"]
[{urlArgs: '424242'}, 'url-args/'],
[{paths: ['test/data/', 'test/less/import/']}, 'include-path/'],
[{paths: 'test/data/'}, 'include-path-string/'],
[{plugin: 'test/plugins/postprocess/'}, 'postProcessorPlugin/'],
[{plugin: 'test/plugins/preprocess/'}, 'preProcessorPlugin/'],
[{plugin: 'test/plugins/visitor/'}, 'visitorPlugin/'],
[{plugin: 'test/plugins/filemanager/'}, 'filemanagerPlugin/'],
[{}, 'no-strict-math/']
];

@@ -64,6 +64,6 @@ testMap.forEach(function(args) {

});
lessTester.testSyncronous({syncImport: true}, "import");
lessTester.testSyncronous({syncImport: true}, "strict-math/css");
lessTester.testSyncronous({syncImport: true}, 'import');
lessTester.testSyncronous({syncImport: true}, 'strict-math/css');
lessTester.testNoOptions();
lessTester.testJSImport();
lessTester.finished();
SyntaxError: Error during @plugin call in {path}plugin-error-2.js{node} on line 3, column 16:
2 use: function() {
3 throw new Error("An error was here.")
3 throw new Error('An error was here.')
4 }
{/node}
SyntaxError: Plugin error during evaluation in {path}plugin-error-3.js{node} on line 3, column 16:
2 eval: function() {
3 throw new Error("An error was here.")
3 throw new Error('An error was here.')
4 }
{/node}
registerPlugin({
use: function() {
throw new Error("An error was here.")
throw new Error('An error was here.')
}
});
registerPlugin({
eval: function() {
throw new Error("An error was here.")
throw new Error('An error was here.')
}
});
functions.addMultiple({
"test-shadow" : function() {
return new tree.Anonymous( "global" );
'test-shadow' : function() {
return new tree.Anonymous( 'global' );
},
"test-global" : function() {
return new tree.Anonymous( "global" );
'test-global' : function() {
return new tree.Anonymous( 'global' );
}
});
functions.addMultiple({
"test-shadow" : function() {
return new tree.Anonymous( "local" );
'test-shadow' : function() {
return new tree.Anonymous( 'local' );
},
"test-local" : function() {
return new tree.Anonymous( "local" );
'test-local' : function() {
return new tree.Anonymous( 'local' );
}

@@ -8,0 +8,0 @@ });

functions.add('foo', function() {
return "foo";
return 'foo';
});
functions.add('foo', function() {
return "bar";
return 'bar';
});
functions.addMultiple({
"test-transitive" : function() {
var anon = new tree.Anonymous( "transitive" );
'test-transitive' : function() {
var anon = new tree.Anonymous( 'transitive' );
return anon;
}
});
functions.addMultiple({
"test-comment": function() {
'test-comment': function() {
return less.combinator(' ');
},
"test-atrule": function(arg1, arg2) {
'test-atrule': function(arg1, arg2) {
return less.atrule(arg1.value, arg2.value);
},
"test-extend": function() {
'test-extend': function() {
// TODO
},
"test-import": function() {
'test-import': function() {
// TODO
},
"test-media": function() {
'test-media': function() {
// TODO
},
"test-mixin-call": function() {
'test-mixin-call': function() {
// TODO
},
"test-mixin-definition": function() {
'test-mixin-definition': function() {
// TODO
},
"test-ruleset-call": function() {
'test-ruleset-call': function() {
return less.combinator(' ');
},
// Functions must return something, even if it's false/true
"test-undefined": function() {
'test-undefined': function() {
return;
},
"test-collapse": function() {
'test-collapse': function() {
return true;
},
// These cause root errors
"test-assignment": function() {
return less.assignment("bird", "robin");
'test-assignment': function() {
return less.assignment('bird', 'robin');
},
"test-attribute": function() {
return less.attribute("foo", "=", "bar");
'test-attribute': function() {
return less.attribute('foo', '=', 'bar');
},
"test-call": function() {
return less.call("foo");
'test-call': function() {
return less.call('foo');
},
"test-color": function() {
'test-color': function() {
return less.color([50, 50, 50]);
},
"test-condition": function() {
'test-condition': function() {
return less.condition('<', less.value([0]), less.value([1]));
},
"test-detached-ruleset" : function() {
'test-detached-ruleset' : function() {
var decl = less.declaration('prop', 'value');
return less.detachedruleset(less.ruleset("", [ decl ]));
return less.detachedruleset(less.ruleset('', [ decl ]));
},
"test-dimension": function() {
'test-dimension': function() {
return less.dimension(1, 'px');
},
"test-element": function() {
'test-element': function() {
return less.element('+', 'a');
},
"test-expression": function() {
'test-expression': function() {
return less.expression([1, 2, 3]);
},
"test-keyword": function() {
'test-keyword': function() {
return less.keyword('foo');
},
"test-operation": function() {
'test-operation': function() {
return less.operation('+', [1, 2]);
},
"test-quoted": function() {
'test-quoted': function() {
return less.quoted('"', 'foo');
},
"test-selector": function() {
'test-selector': function() {
var sel = less.selector('.a.b');
return sel;
},
"test-url": function() {
'test-url': function() {
return less.url('http://google.com');
},
"test-value": function() {
'test-value': function() {
return less.value([1]);
}
});

@@ -17,3 +17,3 @@ /* jshint latedef: nofunc */

var isVerbose = process.env.npm_config_loglevel === 'verbose';
var isVerbose = process.env.npm_config_loglevel !== 'concise';

@@ -34,10 +34,10 @@ var normalFolder = 'test/less';

if (isVerbose) {
process.stdout.write(msg + "\n");
process.stdout.write(msg + '\n');
}
},
warn: function(msg) {
process.stdout.write(msg + "\n");
process.stdout.write(msg + '\n');
},
error: function(msg) {
process.stdout.write(msg + "\n");
process.stdout.write(msg + '\n');
}

@@ -82,3 +82,3 @@ });

_color: function (str) {
if (str.value === "evil red") { return new(less.tree.Color)("600"); }
if (str.value === 'evil red') { return new(less.tree.Color)('600'); }
}

@@ -89,5 +89,5 @@ });

// Check the sourceMappingURL at the bottom of the file
var expectedSourceMapURL = name + ".css.map",
sourceMappingPrefix = "/*# sourceMappingURL=",
sourceMappingSuffix = " */",
var expectedSourceMapURL = name + '.css.map',
sourceMappingPrefix = '/*# sourceMappingURL=',
sourceMappingSuffix = ' */',
expectedCSSAppendage = sourceMappingPrefix + expectedSourceMapURL + sourceMappingSuffix;

@@ -98,3 +98,3 @@ if (!compiledLess.endsWith(expectedCSSAppendage)) {

if (indexOfSourceMappingPrefix === -1) {
fail("ERROR: sourceMappingURL was not found in " + baseFolder + "/" + name + ".css.");
fail('ERROR: sourceMappingURL was not found in ' + baseFolder + '/' + name + '.css.');
return;

@@ -104,19 +104,19 @@ }

var startOfSourceMappingValue = indexOfSourceMappingPrefix + sourceMappingPrefix.length,
indexOfNextSpace = compiledLess.indexOf(" ", startOfSourceMappingValue),
indexOfNextSpace = compiledLess.indexOf(' ', startOfSourceMappingValue),
actualSourceMapURL = compiledLess.substring(startOfSourceMappingValue, indexOfNextSpace === -1 ? compiledLess.length : indexOfNextSpace);
fail("ERROR: sourceMappingURL should be \"" + expectedSourceMapURL + "\" but is \"" + actualSourceMapURL + "\".");
fail('ERROR: sourceMappingURL should be "' + expectedSourceMapURL + '" but is "' + actualSourceMapURL + '".');
}
fs.readFile(path.join('test/', name) + '.json', 'utf8', function (e, expectedSourcemap) {
process.stdout.write("- " + path.join(baseFolder, name) + ": ");
process.stdout.write('- ' + path.join(baseFolder, name) + ': ');
if (sourcemap === expectedSourcemap) {
ok('OK');
} else if (err) {
fail("ERROR: " + (err && err.message));
fail('ERROR: ' + (err && err.message));
if (isVerbose) {
process.stdout.write("\n");
process.stdout.write(err.stack + "\n");
process.stdout.write('\n');
process.stdout.write(err.stack + '\n');
}
} else {
difference("FAIL", expectedSourcemap, sourcemap);
difference('FAIL', expectedSourcemap, sourcemap);
}

@@ -127,12 +127,12 @@ });

function testEmptySourcemap(name, err, compiledLess, doReplacements, sourcemap, baseFolder) {
process.stdout.write("- " + path.join(baseFolder, name) + ": ");
process.stdout.write('- ' + path.join(baseFolder, name) + ': ');
if (err) {
fail("ERROR: " + (err && err.message));
fail('ERROR: ' + (err && err.message));
} else {
var expectedSourcemap = undefined;
if ( compiledLess !== "" ) {
difference("\nCompiledLess must be empty", "", compiledLess);
if ( compiledLess !== '' ) {
difference('\nCompiledLess must be empty', '', compiledLess);
} else if (sourcemap !== expectedSourcemap) {
fail("Sourcemap must be undefined");
fail('Sourcemap must be undefined');
} else {

@@ -146,3 +146,3 @@ ok('OK');

fs.readFile(path.join(baseFolder, name) + '.txt', 'utf8', function (e, expectedErr) {
process.stdout.write('- ' + path.join(baseFolder, name) + ": ");
process.stdout.write('- ' + path.join(baseFolder, name) + ': ');
expectedErr = doReplacements(expectedErr, baseFolder, err && err.filename);

@@ -168,10 +168,10 @@ if (!err) {

function testJSImport() {
process.stdout.write("- Testing root function registry");
process.stdout.write('- Testing root function registry');
less.functions.functionRegistry.add('ext', function() {
return new less.tree.Anonymous('file');
});
var expected = "@charset \"utf-8\";\n";
var expected = '@charset "utf-8";\n';
toCSS({}, require('path').join(process.cwd(), 'test/less/root-registry/root.less'), function(error, output) {
if (error) {
return fail("ERROR: " + error);
return fail('ERROR: ' + error);
}

@@ -181,3 +181,3 @@ if (output.css === expected) {

}
difference("FAIL", expected, output.css);
difference('FAIL', expected, output.css);
});

@@ -189,3 +189,3 @@ }

var p = filename ? path.join(path.dirname(filename), '/') : path.join(process.cwd(), directory),
pathimport = path.join(process.cwd(), directory + "import/"),
pathimport = path.join(process.cwd(), directory + 'import/'),
pathesc = p.replace(/[.:/\\]/g, function(a) { return '\\' + (a == '\\' ? '\/' : a); }),

@@ -195,6 +195,6 @@ pathimportesc = pathimport.replace(/[.:/\\]/g, function(a) { return '\\' + (a == '\\' ? '\/' : a); });

return input.replace(/\{path\}/g, p)
.replace(/\{node\}/g, "")
.replace(/\{\/node\}/g, "")
.replace(/\{pathhref\}/g, "")
.replace(/\{404status\}/g, "")
.replace(/\{node\}/g, '')
.replace(/\{\/node\}/g, '')
.replace(/\{pathhref\}/g, '')
.replace(/\{404status\}/g, '')
.replace(/\{nodepath\}/g, path.join(process.cwd(), 'node_modules', '/'))

@@ -215,3 +215,3 @@ .replace(/\{pathrel\}/g, path.join(path.relative(process.cwd(), p), '/'))

function testSyncronous(options, filenameNoExtension) {
if (oneTestOnly && ("Test Sync " + filenameNoExtension) !== oneTestOnly) {
if (oneTestOnly && ('Test Sync ' + filenameNoExtension) !== oneTestOnly) {
return;

@@ -222,9 +222,9 @@ }

var isSync = true;
toCSS(options, path.join(normalFolder, filenameNoExtension + ".less"), function (err, result) {
process.stdout.write("- Test Sync " + filenameNoExtension + ": ");
toCSS(options, path.join(normalFolder, filenameNoExtension + '.less'), function (err, result) {
process.stdout.write('- Test Sync ' + filenameNoExtension + ': ');
if (isSync) {
ok("OK");
ok('OK');
} else {
fail("Not Sync");
fail('Not Sync');
}

@@ -255,3 +255,3 @@ release();

function runTestSetInternal(baseFolder, options, foldername, verifyFunction, nameModifier, doReplacements, getFilename) {
foldername = foldername || "";
foldername = foldername || '';

@@ -278,5 +278,5 @@ if (!doReplacements) {

if (options.sourceMap && !options.sourceMap.sourceMapFileInline) {
options.sourceMapOutputFilename = name + ".css";
options.sourceMapOutputFilename = name + '.css';
options.sourceMapBasepath = path.join(process.cwd(), baseFolder);
options.sourceMapRootpath = "testweb/";
options.sourceMapRootpath = 'testweb/';
// TODO separate options?

@@ -288,3 +288,3 @@ options.sourceMap = options;

// setting the sourceMappingURL value, leaving just the sourceMapOutputFilename and .map extension.
options.sourceMapFilename = options.sourceMapBasepath + "/" + options.sourceMapOutputFilename + ".map";
options.sourceMapFilename = options.sourceMapBasepath + '/' + options.sourceMapOutputFilename + '.map';
}

@@ -302,5 +302,5 @@

totalTests++;
fail("less is calling back twice");
process.stdout.write(doubleCallCheck + "\n");
process.stdout.write((new Error()).stack + "\n");
fail('less is calling back twice');
process.stdout.write(doubleCallCheck + '\n');
process.stdout.write((new Error()).stack + '\n');
return;

@@ -316,7 +316,7 @@ }

if (err) {
fail("ERROR: " + (err && err.message));
fail('ERROR: ' + (err && err.message));
if (isVerbose) {
process.stdout.write("\n");
process.stdout.write('\n');
if (err.stack) {
process.stdout.write(err.stack + "\n");
process.stdout.write(err.stack + '\n');
} else {

@@ -333,3 +333,3 @@ // this sometimes happen - show the whole error object

fs.readFile(path.join('test/css', css_name) + '.css', 'utf8', function (e, css) {
process.stdout.write("- " + path.join(baseFolder, css_name) + ": ");
process.stdout.write('- ' + path.join(baseFolder, css_name) + ': ');

@@ -339,3 +339,3 @@ css = css && doReplacements(css, path.join(baseFolder, foldername));

else {
difference("FAIL", css, result.css);
difference('FAIL', css, result.css);
}

@@ -352,3 +352,3 @@ release();

if (item.added || item.removed) {
var text = item.value && item.value.replace("\n", String.fromCharCode(182) + "\n").replace('\ufeff', '[[BOM]]');
var text = item.value && item.value.replace('\n', String.fromCharCode(182) + '\n').replace('\ufeff', '[[BOM]]');
process.stdout.write(stylize(text, item.added ? 'green' : 'red'));

@@ -359,7 +359,7 @@ } else {

});
process.stdout.write("\n");
process.stdout.write('\n');
}
function fail(msg) {
process.stdout.write(stylize(msg, 'red') + "\n");
process.stdout.write(stylize(msg, 'red') + '\n');
failedTests++;

@@ -370,3 +370,3 @@ endTest();

function difference(msg, left, right) {
process.stdout.write(stylize(msg, 'yellow') + "\n");
process.stdout.write(stylize(msg, 'yellow') + '\n');
failedTests++;

@@ -379,3 +379,3 @@

function ok(msg) {
process.stdout.write(stylize(msg, 'green') + "\n");
process.stdout.write(stylize(msg, 'green') + '\n');
passedTests++;

@@ -394,11 +394,11 @@ endTest();

var leaked = checkGlobalLeaks();
process.stdout.write("\n");
process.stdout.write('\n');
if (failedTests > 0) {
process.stdout.write(failedTests + stylize(" Failed", "red") + ", " + passedTests + " passed\n");
process.stdout.write(failedTests + stylize(' Failed', 'red') + ', ' + passedTests + ' passed\n');
} else {
process.stdout.write(stylize("All Passed ", "green") + passedTests + " run\n");
process.stdout.write(stylize('All Passed ', 'green') + passedTests + ' run\n');
}
if (leaked.length > 0) {
process.stdout.write("\n");
process.stdout.write(stylize("Global leak detected: ", "red") + leaked.join(', ') + "\n");
process.stdout.write('\n');
process.stdout.write(stylize('Global leak detected: ', 'red') + leaked.join(', ') + '\n');
}

@@ -424,3 +424,3 @@

var str = fs.readFileSync(path, 'utf8'), addPath = require('path').dirname(path);
if (typeof options.paths !== "string") {
if (typeof options.paths !== 'string') {
options.paths = options.paths || [];

@@ -447,3 +447,3 @@ if (!contains(options.paths, addPath)) {

function testNoOptions() {
if (oneTestOnly && "Integration" !== oneTestOnly) {
if (oneTestOnly && 'Integration' !== oneTestOnly) {
return;

@@ -453,9 +453,9 @@ }

try {
process.stdout.write("- Integration - creating parser without options: ");
less.render("");
process.stdout.write('- Integration - creating parser without options: ');
less.render('');
} catch (e) {
fail(stylize("FAIL\n", "red"));
fail(stylize('FAIL\n', 'red'));
return;
}
ok(stylize("OK\n", "green"));
ok(stylize('OK\n', 'green'));
}

@@ -462,0 +462,0 @@

SyntaxError: Error during @plugin call in {path}plugin-error-2.js{node} on line 3, column 16:
2 use: function() {
3 throw new Error("An error was here.")
3 throw new Error('An error was here.')
4 }
{/node}
SyntaxError: Plugin error during evaluation in {path}plugin-error-3.js{node} on line 3, column 16:
2 eval: function() {
3 throw new Error("An error was here.")
3 throw new Error('An error was here.')
4 }
{/node}
registerPlugin({
use: function() {
throw new Error("An error was here.")
throw new Error('An error was here.')
}
});
registerPlugin({
eval: function() {
throw new Error("An error was here.")
throw new Error('An error was here.')
}
});
functions.addMultiple({
"test-shadow" : function() {
return new tree.Anonymous( "global" );
'test-shadow' : function() {
return new tree.Anonymous( 'global' );
},
"test-global" : function() {
return new tree.Anonymous( "global" );
'test-global' : function() {
return new tree.Anonymous( 'global' );
}
});
functions.addMultiple({
"test-shadow" : function() {
return new tree.Anonymous( "local" );
'test-shadow' : function() {
return new tree.Anonymous( 'local' );
},
"test-local" : function() {
return new tree.Anonymous( "local" );
'test-local' : function() {
return new tree.Anonymous( 'local' );
}

@@ -8,0 +8,0 @@ });

functions.add('foo', function() {
return "foo";
return 'foo';
});
functions.add('foo', function() {
return "bar";
return 'bar';
});
functions.addMultiple({
"test-transitive" : function() {
var anon = new tree.Anonymous( "transitive" );
'test-transitive' : function() {
var anon = new tree.Anonymous( 'transitive' );
return anon;
}
});
functions.addMultiple({
"test-comment": function() {
'test-comment': function() {
return less.combinator(' ');
},
"test-atrule": function(arg1, arg2) {
'test-atrule': function(arg1, arg2) {
return less.atrule(arg1.value, arg2.value);
},
"test-extend": function() {
'test-extend': function() {
// TODO
},
"test-import": function() {
'test-import': function() {
// TODO
},
"test-media": function() {
'test-media': function() {
// TODO
},
"test-mixin-call": function() {
'test-mixin-call': function() {
// TODO
},
"test-mixin-definition": function() {
'test-mixin-definition': function() {
// TODO
},
"test-ruleset-call": function() {
'test-ruleset-call': function() {
return less.combinator(' ');
},
// Functions must return something, even if it's false/true
"test-undefined": function() {
'test-undefined': function() {
return;
},
"test-collapse": function() {
'test-collapse': function() {
return true;
},
// These cause root errors
"test-assignment": function() {
return less.assignment("bird", "robin");
'test-assignment': function() {
return less.assignment('bird', 'robin');
},
"test-attribute": function() {
return less.attribute("foo", "=", "bar");
'test-attribute': function() {
return less.attribute('foo', '=', 'bar');
},
"test-call": function() {
return less.call("foo");
'test-call': function() {
return less.call('foo');
},
"test-color": function() {
'test-color': function() {
return less.color([50, 50, 50]);
},
"test-condition": function() {
'test-condition': function() {
return less.condition('<', less.value([0]), less.value([1]));
},
"test-detached-ruleset" : function() {
'test-detached-ruleset' : function() {
var decl = less.declaration('prop', 'value');
return less.detachedruleset(less.ruleset("", [ decl ]));
return less.detachedruleset(less.ruleset('', [ decl ]));
},
"test-dimension": function() {
'test-dimension': function() {
return less.dimension(1, 'px');
},
"test-element": function() {
'test-element': function() {
return less.element('+', 'a');
},
"test-expression": function() {
'test-expression': function() {
return less.expression([1, 2, 3]);
},
"test-keyword": function() {
'test-keyword': function() {
return less.keyword('foo');
},
"test-operation": function() {
'test-operation': function() {
return less.operation('+', [1, 2]);
},
"test-quoted": function() {
'test-quoted': function() {
return less.quoted('"', 'foo');
},
"test-selector": function() {
'test-selector': function() {
var sel = less.selector('.a.b');
return sel;
},
"test-url": function() {
'test-url': function() {
return less.url('http://google.com');
},
"test-value": function() {
'test-value': function() {
return less.value([1]);
}
});
var less = require('../lib/less'),
fs = require('fs');
var input = fs.readFileSync("./test/less/modifyVars/extended.less", 'utf8');
var input = fs.readFileSync('./test/less/modifyVars/extended.less', 'utf8');
var expectedCss = fs.readFileSync('./test/css/modifyVars/extended.css', 'utf8');
var options = {
modifyVars: JSON.parse(fs.readFileSync("./test/less/modifyVars/extended.json", 'utf8'))
modifyVars: JSON.parse(fs.readFileSync('./test/less/modifyVars/extended.json', 'utf8'))
};

@@ -15,6 +15,6 @@

if (result.css === expectedCss) {
console.log("PASS");
console.log('PASS');
} else {
console.log("FAIL");
console.log('FAIL');
}
});

@@ -7,3 +7,3 @@ (function(exports) {

if (filename.match(/.*\.test$/)) {
return less.environment.fileManagers[0].loadFile("colors.test", currentDirectory, options, environment, callback);
return less.environment.fileManagers[0].loadFile('colors.test', currentDirectory, options, environment, callback);
}

@@ -10,0 +10,0 @@ return less.environment.fileManagers[0].loadFile(filename, currentDirectory, options, environment, callback);

@@ -11,3 +11,3 @@ function initRhinoTest() {

less.tree.functions._color = function (str) {
if (str.value === "evil red") { return new(less.tree.Color)("600"); }
if (str.value === 'evil red') { return new(less.tree.Color)('600'); }
};

@@ -14,0 +14,0 @@ }

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc