lib/less/js/lib/less/tree/ruleset.js in less-2.0.7 vs lib/less/js/lib/less/tree/ruleset.js in less-2.0.8beta1
- old
+ new
@@ -88,11 +88,11 @@
this.rulesets().forEach(function (rule) {
if (rule !== self) {
for (var j = 0; j < rule.selectors.length; j++) {
if (match = selector.match(rule.selectors[j])) {
- if (selector.elements.length > 1) {
+ if (selector.elements.length > rule.selectors[j].elements.length) {
Array.prototype.push.apply(rules, rule.find(
new(tree.Selector)(selector.elements.slice(1)), self));
} else {
rules.push(rule);
}
@@ -182,11 +182,11 @@
var before = [], after = [], beforeElements = [],
afterElements = [], hasParentSelector = false, el;
for (var i = 0; i < selector.elements.length; i++) {
el = selector.elements[i];
- if (el.combinator.value[0] === '&') {
+ if (el.combinator.value.charAt(0) === '&') {
hasParentSelector = true;
}
if (hasParentSelector) afterElements.push(el);
else beforeElements.push(el);
}
@@ -207,6 +207,6 @@
for (var c = 0; c < context.length; c++) {
paths.push(before.concat(context[c]).concat(after));
}
}
};
-})(require('less/tree'));
+})(require('../tree'));