Get simple extension working.

This commit is contained in:
Natalie Weizenbaum 2016-08-14 13:57:27 -07:00
parent 69221190e7
commit e0333b303c
3 changed files with 8 additions and 4 deletions

View File

@ -27,7 +27,9 @@ class ComplexSelector extends Selector {
ComplexSelector(Iterable<ComplexSelectorComponent> components,
{Iterable<int> lineBreaks})
: components = new List.unmodifiable(components),
lineBreaks = new List.unmodifiable(lineBreaks);
lineBreaks = lineBreaks == null
? const []
: new List.unmodifiable(lineBreaks);
bool isSuperselector(ComplexSelector other) =>
complexIsSuperselector(components, other.components);

View File

@ -14,7 +14,8 @@ class SelectorList extends Selector {
SelectorList(Iterable<ComplexSelector> components, {Iterable<int> lineBreaks})
: components = new List.unmodifiable(components),
lineBreaks = new List.unmodifiable(lineBreaks);
lineBreaks =
lineBreaks == null ? const [] : new List.unmodifiable(lineBreaks);
bool isSuperselector(SelectorList other) =>
listIsSuperslector(components, other.components);

View File

@ -143,8 +143,9 @@ class Extender {
for (var list in extenders) {
for (var complex in list.components) {
var extenderBase = complex.components.last as CompoundSelector;
var unified = _unifyCompound(
extenderBase.components, compoundWithoutSimple);
var unified = compoundWithoutSimple.isEmpty
? extenderBase
: _unifyCompound(extenderBase.components, compoundWithoutSimple);
if (unified == null) continue;
if (!changed) extended = [[compound]];