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.5.0-beta.3 to 3.5.0-beta.4

.vscode/launch.json

1

lib/less/tree/index.js

@@ -40,3 +40,4 @@ var tree = Object.create(null);

tree.VariableCall = require('./variable-call');
tree.NamespaceValue = require('./namespace-value');
module.exports = tree;

@@ -31,2 +31,4 @@ var Node = require('./node'),

this.selector = this.selector.eval(context);
function calcDefGroup(mixin, mixinPath) {

@@ -33,0 +35,0 @@ var f, p, namespace;

@@ -5,2 +5,3 @@ var Selector = require('./selector'),

Declaration = require('./declaration'),
DetachedRuleset = require('./detached-ruleset'),
Expression = require('./expression'),

@@ -101,3 +102,9 @@ contexts = require('../contexts'),

if (val) {
val = val.eval(context);
// This was a mixin call, pass in a detached ruleset of it's eval'd rules
if (Array.isArray(val)) {
val = new DetachedRuleset(new Ruleset('', val));
}
else {
val = val.eval(context);
}
} else if (params[i].value) {

@@ -104,0 +111,0 @@ val = params[i].value.eval(mixinEnv);

var Node = require('./node'),
Variable = require('./variable');
Variable = require('./variable'),
Ruleset = require('./ruleset'),
DetachedRuleset = require('./detached-ruleset'),
LessError = require('../less-error');
var VariableCall = function (variable) {
var VariableCall = function (variable, index, currentFileInfo) {
this.variable = variable;
this._index = index;
this._fileInfo = currentFileInfo;
this.allowRoot = true;

@@ -11,5 +16,22 @@ };

VariableCall.prototype.eval = function (context) {
var detachedRuleset = new Variable(this.variable).eval(context);
return detachedRuleset.callEval(context);
var rules, detachedRuleset = new Variable(this.variable, this.getIndex(), this.fileInfo()).eval(context),
error = new LessError({message: 'Could not evaluate variable call ' + this.variable});
if (!detachedRuleset.ruleset) {
if (Array.isArray(detachedRuleset)) {
rules = detachedRuleset;
}
else if (Array.isArray(detachedRuleset.value)) {
rules = detachedRuleset.value;
}
else {
throw error;
}
detachedRuleset = new DetachedRuleset(new Ruleset('', rules));
}
if (detachedRuleset.ruleset) {
return detachedRuleset.callEval(context);
}
throw error;
};
module.exports = VariableCall;

2

package.json
{
"name": "less",
"version": "3.5.0-beta.3",
"version": "3.5.0-beta.4",
"description": "Leaner CSS",

@@ -5,0 +5,0 @@ "homepage": "http://lesscss.org",

@@ -10,2 +10,3 @@ var lessTest = require('./less-test'),

var testMap = [
[{}, 'edge/'],
[{

@@ -12,0 +13,0 @@ strictMath: false,

@@ -252,3 +252,3 @@ /* jshint latedef: nofunc */

fs.readdirSync(path.join(baseFolder, foldername)).forEach(function (file) {
if (!/\.less/.test(file)) { return; }
if (!/\.less$/.test(file)) { return; }

@@ -255,0 +255,0 @@ var name = getBasename(file);

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

ParseError: Expected ')' in {path}detached-ruleset-2.less on line 5, column 9:
ParseError: Missing '[...]' lookup in variable call in {path}detached-ruleset-2.less on line 5, column 8:
4 .a {
5 a: @a();
6 }

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