From c44481ba29d2fc0040bd690fe2f1219e7b9f067b Mon Sep 17 00:00:00 2001 From: Natalie Weizenbaum Date: Tue, 18 Oct 2016 21:45:25 -0700 Subject: [PATCH] Fix blank lists in property values. --- lib/src/visitor/perform.dart | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/src/visitor/perform.dart b/lib/src/visitor/perform.dart index d616e004..e3b3ba2b 100644 --- a/lib/src/visitor/perform.dart +++ b/lib/src/visitor/perform.dart @@ -245,7 +245,7 @@ class _PerformVisitor implements StatementVisitor, ExpressionVisitor { // If the value is an empty list, preserve it, because converting it to CSS // will throw an error that we want the user to see. if (cssValue != null && - (!cssValue.value.isBlank || cssValue.value is SassList)) { + (!cssValue.value.isBlank || _isEmptyList(cssValue.value))) { _parent.addChild(new CssDeclaration(name, cssValue, node.span)); } @@ -259,6 +259,9 @@ class _PerformVisitor implements StatementVisitor, ExpressionVisitor { } } + /// Returns whether [value] is an empty [SassList]. + bool _isEmptyList(Value value) => value is List && value.contents.isEmpty; + Value visitEachRule(EachRule node) { var list = node.list.accept(this); var setVariables = node.variables.length == 1