Skip to content
This repository was archived by the owner on Oct 24, 2025. It is now read-only.

Commit 8c9547e

Browse files
If the argument is a list, use its separator in function compact.
1 parent 236f1ad commit 8c9547e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

functions.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -898,6 +898,7 @@ namespace Sass {
898898
BUILT_IN(compact)
899899
{
900900
List* arglist = ARG("$values", List);
901+
List::Separator sep = List::COMMA;
901902
if (arglist->length() == 1) {
902903
Expression* the_arg = arglist->value_at_index(0);
903904
arglist = dynamic_cast<List*>(the_arg);
@@ -906,8 +907,9 @@ namespace Sass {
906907
*result << the_arg;
907908
return result;
908909
}
910+
sep = arglist->separator();
909911
}
910-
List* result = new (ctx.mem) List(path, position, 0, List::COMMA);
912+
List* result = new (ctx.mem) List(path, position, 0, sep);
911913
for (size_t i = 0, L = arglist->length(); i < L; ++i) {
912914
Boolean* ith = dynamic_cast<Boolean*>(arglist->value_at_index(i));
913915
if (ith && ith->value() == false) continue;

0 commit comments

Comments
 (0)