Skip to content

Commit

Permalink
Empty maps have undecided separators
Browse files Browse the repository at this point in the history
Closes #737
  • Loading branch information
nex3 committed Jul 3, 2019
1 parent 821b5e2 commit 9895eef
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@
inserts at the end of the string if the `$index` is `-1`. This matches the
behavior in LibSass and originally in Ruby Sass.

* **Potentially breaking bug fix**: An empty map returned by `map-remove()` is
now treated as identical to the literal value `()`, rather than being treated
as though it had a comma separator. This matches the original behavior in Ruby
Sass.

* The `adjust-color()` function no longer throws an error when a large `$alpha`
value is combined with HSL adjustments.

Expand Down
3 changes: 2 additions & 1 deletion lib/src/value/map.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import 'external/value.dart' as ext;
class SassMap extends Value implements ext.SassMap {
final Map<Value, Value> contents;

ListSeparator get separator => ListSeparator.comma;
ListSeparator get separator =>
contents.isEmpty ? ListSeparator.undecided : ListSeparator.comma;

List<Value> get asList {
var result = <Value>[];
Expand Down

0 comments on commit 9895eef

Please sign in to comment.