A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/sass/libsass/issues/628 below:

Parser should catch error on duplicate keys in maps · Issue #628 · sass/libsass · GitHub

So, ruby-sass throws an error when a map is declared that has any duplicate keys, including any at nested levels. i.e. maps that are values or keys within other maps:

$map: (
  alpha: 1,
  beta: 2,
  gamma: 3,
  delta: (
    eta: 5,
    eta: 6,
  ),
);
Duplicate key "eta" in map (eta: 5, eta: 6).

Libsass currently does not run this check, and should; however, libsass can also do better than ruby-sass here. Note that ruby-sass fails to pick up duplicate-key maps that result from other operations. Example:

$map1: (
  alpha: 1,
  beta: 2,
  gamma: 3,
);

$map2: (
  alpha: 2
);

$map3: join($map1, $map2);

.test {
  out: inspect($map3);
}
.test {
  out: alpha 1, beta 2, gamma 3, alpha 2;
}

So imo libsass should have a map-validity check routine that runs on anything that involves SassScript maps or lists (as the latter may contain a map) as outputs or assignments.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4