lib/less/js/lib/less/tree/selector.js in less-2.0.7 vs lib/less/js/lib/less/tree/selector.js in less-2.0.8beta1
- old
+ new
@@ -5,15 +5,24 @@
if (this.elements[0].combinator.value === "") {
this.elements[0].combinator.value = ' ';
}
};
tree.Selector.prototype.match = function (other) {
- if (this.elements[0].value === other.elements[0].value) {
- return true;
- } else {
+ var len = this.elements.length,
+ olen = other.elements.length,
+ max = Math.min(len, olen);
+
+ if (len < olen) {
return false;
+ } else {
+ for (var i = 0; i < max; i++) {
+ if (this.elements[i].value !== other.elements[i].value) {
+ return false;
+ }
+ }
}
+ return true;
};
tree.Selector.prototype.toCSS = function (env) {
if (this._css) { return this._css }
return this._css = this.elements.map(function (e) {
@@ -23,6 +32,6 @@
return e.toCSS(env);
}
}).join('');
};
-})(require('less/tree'));
+})(require('../tree'));