Remove leading underscore on local identifiers

This commit is contained in:
Christophe Coevoet 2022-09-03 00:15:22 +02:00
parent 35cd8a77d9
commit fec9a2aced
2 changed files with 7 additions and 7 deletions

View File

@ -170,7 +170,7 @@ final _hasKey = _function("has-key", r"$map, $key, $keys...", (arguments) {
Value _modify(SassMap map, Iterable<Value> keys, Value modify(Value old), Value _modify(SassMap map, Iterable<Value> keys, Value modify(Value old),
{bool addNesting = true}) { {bool addNesting = true}) {
var keyIterator = keys.iterator; var keyIterator = keys.iterator;
SassMap _modifyNestedMap(SassMap map) { SassMap modifyNestedMap(SassMap map) {
var mutableMap = Map.of(map.contents); var mutableMap = Map.of(map.contents);
var key = keyIterator.current; var key = keyIterator.current;
@ -182,11 +182,11 @@ Value _modify(SassMap map, Iterable<Value> keys, Value modify(Value old),
var nestedMap = mutableMap[key]?.tryMap(); var nestedMap = mutableMap[key]?.tryMap();
if (nestedMap == null && !addNesting) return SassMap(mutableMap); if (nestedMap == null && !addNesting) return SassMap(mutableMap);
mutableMap[key] = _modifyNestedMap(nestedMap ?? const SassMap.empty()); mutableMap[key] = modifyNestedMap(nestedMap ?? const SassMap.empty());
return SassMap(mutableMap); return SassMap(mutableMap);
} }
return keyIterator.moveNext() ? _modifyNestedMap(map) : modify(map); return keyIterator.moveNext() ? modifyNestedMap(map) : modify(map);
} }
/// Merges [map1] and [map2], with values in [map2] taking precedence. /// Merges [map1] and [map2], with values in [map2] taking precedence.

View File

@ -593,7 +593,7 @@ abstract class SassNumber extends Value {
var otherHasUnits = newNumerators.isNotEmpty || newDenominators.isNotEmpty; var otherHasUnits = newNumerators.isNotEmpty || newDenominators.isNotEmpty;
if (coerceUnitless && (!hasUnits || !otherHasUnits)) return this.value; if (coerceUnitless && (!hasUnits || !otherHasUnits)) return this.value;
SassScriptException _compatibilityException() { SassScriptException compatibilityException() {
if (other != null) { if (other != null) {
var message = StringBuffer("$this and"); var message = StringBuffer("$this and");
if (otherName != null) message.write(" \$$otherName:"); if (otherName != null) message.write(" \$$otherName:");
@ -634,7 +634,7 @@ abstract class SassNumber extends Value {
if (factor == null) return false; if (factor == null) return false;
value *= factor; value *= factor;
return true; return true;
}, orElse: () => throw _compatibilityException()); }, orElse: () => throw compatibilityException());
} }
var oldDenominators = denominatorUnits.toList(); var oldDenominators = denominatorUnits.toList();
@ -644,11 +644,11 @@ abstract class SassNumber extends Value {
if (factor == null) return false; if (factor == null) return false;
value /= factor; value /= factor;
return true; return true;
}, orElse: () => throw _compatibilityException()); }, orElse: () => throw compatibilityException());
} }
if (oldNumerators.isNotEmpty || oldDenominators.isNotEmpty) { if (oldNumerators.isNotEmpty || oldDenominators.isNotEmpty) {
throw _compatibilityException(); throw compatibilityException();
} }
return value; return value;