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

browser
cloudhead 15 years ago
parent 22eedab7dd
commit 74ec956602

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

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

Loading…
Cancel
Save