stateless URL evaluation

This commit is contained in:
cloudhead
2010-07-25 17:01:27 -04:00
parent da62bf3eb4
commit e17314e653

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