mirror of
https://github.com/less/less.js.git
synced 2026-01-22 21:58:14 -05:00
fixed bug with passing variables to functions
This commit is contained in:
@@ -23,7 +23,7 @@ tree.Call.prototype = {
|
||||
// The function should receive the value, not the variable.
|
||||
//
|
||||
toCSS: function (context, env) {
|
||||
var args = this.args.map(function (a) { return a.eval() });
|
||||
var args = this.args.map(function (a) { return a.eval(context) });
|
||||
|
||||
if (this.name in tree.functions) { // 1.
|
||||
return tree.functions[this.name].apply(tree.functions, args).toCSS();
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
width: 16;
|
||||
height: undefined("self");
|
||||
border-width: 5;
|
||||
variable: 11;
|
||||
}
|
||||
#built-in {
|
||||
escaped: -Some::weird(#thing, y);
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
#functions {
|
||||
@var: 10;
|
||||
color: color("evil red"); // #660000
|
||||
width: increment(15);
|
||||
height: undefined("self");
|
||||
border-width: add(2, 3);
|
||||
variable: increment(@var);
|
||||
}
|
||||
|
||||
#built-in {
|
||||
|
||||
Reference in New Issue
Block a user