mirror of
https://github.com/danog/dart-sass.git
synced 2025-01-21 21:31:11 +01:00
Remove redundant parameters.
This commit is contained in:
parent
4e0a511570
commit
cba5881eb4
@ -53,21 +53,22 @@ class Environment {
|
||||
Callable getFunction(String name) =>
|
||||
_functions[_functionIndices[name] ?? 0][name];
|
||||
|
||||
void setFunction(String name, Callable callable) {
|
||||
void setFunction(Callable callable) {
|
||||
var index = _functions.length == 1
|
||||
? 0
|
||||
: _functionIndices.putIfAbsent(name, () => _functions.length - 1);
|
||||
_functions[index][name] = callable;
|
||||
: _functionIndices.putIfAbsent(
|
||||
callable.name, () => _functions.length - 1);
|
||||
_functions[index][callable.name] = callable;
|
||||
}
|
||||
|
||||
Callable getMixin(String name) =>
|
||||
_mixins[_mixinIndices[name] ?? 0][name];
|
||||
|
||||
void setMixin(String name, Callable callable) {
|
||||
void setMixin(Callable callable) {
|
||||
var index = _mixins.length == 1
|
||||
? 0
|
||||
: _mixinIndices.putIfAbsent(name, () => _mixins.length - 1);
|
||||
_mixins[index][name] = callable;
|
||||
: _mixinIndices.putIfAbsent(callable.name, () => _mixins.length - 1);
|
||||
_mixins[index][callable.name] = callable;
|
||||
}
|
||||
|
||||
/*=T*/ scope/*<T>*/(/*=T*/ callback()) {
|
||||
|
@ -124,7 +124,7 @@ class PerformVisitor extends StatementVisitor
|
||||
}
|
||||
|
||||
void visitFunctionDeclaration(FunctionDeclaration node) {
|
||||
_environment.setFunction(node.name, new Callable(
|
||||
_environment.setFunction(new Callable(
|
||||
node.name, node.arguments, node.children, _environment.closure(),
|
||||
span: node.span));
|
||||
}
|
||||
@ -144,7 +144,7 @@ class PerformVisitor extends StatementVisitor
|
||||
}
|
||||
|
||||
void visitMixinDeclaration(MixinDeclaration node) {
|
||||
_environment.setMixin(node.name, new Callable(
|
||||
_environment.setMixin(new Callable(
|
||||
node.name, node.arguments, node.children, _environment.closure(),
|
||||
span: node.span));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user