mirror of
https://github.com/danog/dart-sass.git
synced 2024-11-30 04:39:03 +01:00
Remove leading underscore on local identifiers
This commit is contained in:
parent
35cd8a77d9
commit
fec9a2aced
@ -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.
|
||||||
|
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user