mirror of
https://github.com/danog/dart-sass.git
synced 2024-11-26 20:24:42 +01:00
Make Environment.scope scope mixins and functions.
This commit is contained in:
parent
bbaf8a5a2f
commit
631f0870ac
@ -76,13 +76,21 @@ class Environment {
|
||||
|
||||
/*=T*/ scope/*<T>*/(/*=T*/ callback()) {
|
||||
// TODO: avoid creating a new scope if no variables are declared.
|
||||
_variables.add({});
|
||||
_variables.add(normalizedMap());
|
||||
_functions.add(normalizedMap());
|
||||
_mixins.add(normalizedMap());
|
||||
try {
|
||||
return callback();
|
||||
} finally {
|
||||
for (var name in _variables.removeLast().keys) {
|
||||
_variableIndices.remove(name);
|
||||
}
|
||||
for (var name in _functions.removeLast().keys) {
|
||||
_functionIndices.remove(name);
|
||||
}
|
||||
for (var name in _mixins.removeLast().keys) {
|
||||
_mixinIndices.remove(name);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user