diff --git a/lib/less/parser.js b/lib/less/parser.js index 9657eb4e8..76e130ce3 100644 --- a/lib/less/parser.js +++ b/lib/less/parser.js @@ -801,7 +801,7 @@ less.Parser = function Parser(env) { if (e) { return new(tree.Element)(c, e, i) } - if (c.value && c.value[0] === '&') { + if (c.value && c.value.charAt(0) === '&') { return new(tree.Element)(c, null, i); } }, diff --git a/lib/less/tree/ruleset.js b/lib/less/tree/ruleset.js index cc9a60aec..39da8ebe8 100644 --- a/lib/less/tree/ruleset.js +++ b/lib/less/tree/ruleset.js @@ -184,7 +184,7 @@ tree.Ruleset.prototype = { 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);