From 8019439eb4f52476bdfd4ae3665ee1ace500afcf Mon Sep 17 00:00:00 2001 From: Dustin Cass Date: Fri, 21 Sep 2012 17:00:23 -0700 Subject: [PATCH] Pass env with toCSS in function call evaluation; Add tests; Fixes #957 --- lib/less/tree/call.js | 2 +- test/css/functions.css | 1 + test/less/functions.less | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/less/tree/call.js b/lib/less/tree/call.js index c1465dd4..7c2d21e6 100644 --- a/lib/less/tree/call.js +++ b/lib/less/tree/call.js @@ -36,7 +36,7 @@ tree.Call.prototype = { } } else { // 2. return new(tree.Anonymous)(this.name + - "(" + args.map(function (a) { return a.toCSS() }).join(', ') + ")"); + "(" + args.map(function (a) { return a.toCSS(env) }).join(', ') + ")"); } }, diff --git a/test/css/functions.css b/test/css/functions.css index 7a595f70..933370b1 100644 --- a/test/css/functions.css +++ b/test/css/functions.css @@ -4,6 +4,7 @@ height: undefined("self"); border-width: 5; variable: 11; + background: linear-gradient(#000000, #ffffff); } #built-in { escaped: -Some::weird(#thing, y); diff --git a/test/less/functions.less b/test/less/functions.less index 7e599e23..0eb3bad4 100644 --- a/test/less/functions.less +++ b/test/less/functions.less @@ -1,10 +1,12 @@ #functions { @var: 10; + @colors: #000, #fff; color: _color("evil red"); // #660000 width: increment(15); height: undefined("self"); border-width: add(2, 3); variable: increment(@var); + background: linear-gradient(@colors); } #built-in {