stateless URL evaluation

This commit is contained in:
cloudhead 2010-07-25 17:01:27 -04:00
parent 059a3208b5
commit e9d4499789

View File

@ -6,14 +6,14 @@ tree.URL = function (val, paths) {
val.value = [paths[0], val.value].join('/').replace('//', '/');
}
this.value = val;
this.paths = paths;
};
tree.URL.prototype = {
toCSS: function () {
return "url(" + this.value.toCSS() + ")";
},
eval: function (ctx) {
this.value = this.value.eval(ctx);
return this;
return new(tree.URL)(this.value.eval(ctx), this.paths);
}
};