Skip to content

Commit 003d3dc

Browse files
committed
Merge pull request #835 from xzyfer/feat/remove-compact
Remove the non-standard compact function
2 parents c0a015b + 3372964 commit 003d3dc

File tree

1 file changed

+2
-19
lines changed

1 file changed

+2
-19
lines changed

functions.cpp

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1233,25 +1233,8 @@ namespace Sass {
12331233
Signature compact_sig = "compact($values...)";
12341234
BUILT_IN(compact)
12351235
{
1236-
List* arglist = ARG("$values", List);
1237-
List::Separator sep = List::COMMA;
1238-
if (arglist->length() == 1) {
1239-
Expression* the_arg = arglist->value_at_index(0);
1240-
arglist = dynamic_cast<List*>(the_arg);
1241-
if (!arglist) {
1242-
List* result = new (ctx.mem) List(pstate, 1, List::COMMA);
1243-
*result << the_arg;
1244-
return result;
1245-
}
1246-
sep = arglist->separator();
1247-
}
1248-
List* result = new (ctx.mem) List(pstate, 0, sep);
1249-
for (size_t i = 0, L = arglist->length(); i < L; ++i) {
1250-
Boolean* ith = dynamic_cast<Boolean*>(arglist->value_at_index(i));
1251-
if (ith && ith->value() == false) continue;
1252-
*result << arglist->value_at_index(i);
1253-
}
1254-
return result;
1236+
error("`compact` has been removed from libsass because it's not part of the Sass spec", pstate);
1237+
return 0;
12551238
}
12561239

12571240
Signature list_separator_sig = "list_separator($list)";

0 commit comments

Comments
 (0)