just return self if trying to evaluate compound values, seeing as we use eval() for variable lookup/eval

This commit is contained in:
cloudhead 2010-03-05 13:32:07 -05:00
parent 22eedab7dd
commit 74ec956602
2 changed files with 2 additions and 2 deletions

View File

@ -3,7 +3,7 @@ if (typeof(window) === 'undefined') { var tree = require(require('path').join(__
tree.Expression = function Expression(value) { this.value = value };
tree.Expression.prototype.eval = function (env) {
if (this.value.length > 1) {
throw new(Error)("can't eval compound expression");
return this;
} else {
return this.value[0].eval(env);
}

View File

@ -24,7 +24,7 @@ tree.Value.prototype.eval = function (env) {
if (this.value.length === 1) {
return this.value[0].eval(env);
} else {
throw new(Error)("trying to evaluate compound value");
return this;
}
};
tree.Value.prototype.toCSS = function (env) {