fixed bug with passing variables to functions

This commit is contained in:
cloudhead
2010-04-23 13:49:55 -04:00
parent d0b5f6f214
commit fee1e305f0
3 changed files with 4 additions and 1 deletions

View File

@@ -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();

View File

@@ -3,6 +3,7 @@
width: 16;
height: undefined("self");
border-width: 5;
variable: 11;
}
#built-in {
escaped: -Some::weird(#thing, y);

View File

@@ -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 {