Skip to content

Commit 675460f

Browse files
author
Hampton Catlin
committed
Merge branch 'xzyfer-fix/issue_510't push origin master
2 parents a0cacf3 + a67f368 commit 675460f

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

functions.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1246,14 +1246,19 @@ namespace Sass {
12461246
return result;
12471247
}
12481248

1249-
Signature map_remove_sig = "map-remove($map, $key)";
1249+
Signature map_remove_sig = "map-remove($map, $keys...)";
12501250
BUILT_IN(map_remove)
12511251
{
1252+
bool remove;
12521253
Map* m = ARGM("$map", Map, ctx);
1253-
Expression* v = ARG("$key", Expression);
1254+
List* arglist = ARG("$keys", List);
12541255
Map* result = new (ctx.mem) Map(path, position, 1);
12551256
for (size_t i = 0, L = m->length(); i < L; ++i) {
1256-
if (!eq((*m)[i]->key(), v, ctx)) *result << (*m)[i];
1257+
remove = false;
1258+
for (size_t j = 0, K = arglist->length(); j < K && !remove; ++j) {
1259+
remove = eq((*m)[i]->key(), arglist->value_at_index(j), ctx);
1260+
}
1261+
if (!remove) *result << (*m)[i];
12571262
}
12581263
return result;
12591264
}

0 commit comments

Comments
 (0)