Element constructor creates new Combinator if a string was passed

This commit is contained in:
cloudhead 2010-03-04 13:48:24 -05:00
parent d860763454
commit 9cf5f74d31

View File

@ -1,7 +1,8 @@
if (typeof(window) === 'undefined') { var tree = require(require('path').join(__dirname, '..', '..', 'less', 'tree')); }
tree.Element = function Element(combinator, value) {
this.combinator = combinator || new(tree.Combinator);
this.combinator = combinator instanceof tree.Combinator ?
combinator : new(tree.Combinator)(combinator);
this.value = value.trim();
};
tree.Element.prototype.toCSS = function () {