arguments do not affect variables in outer scopes

This commit is contained in:
Connor Skees 2020-08-15 21:33:44 -04:00
parent 74bb9bad92
commit a9be640124
2 changed files with 18 additions and 1 deletions

View File

@ -390,7 +390,7 @@ impl<'a> Parser<'a> {
},
}?
.node;
self.scopes.insert_var(arg.name, val.clone());
self.scopes.insert_var_last(arg.name, val.clone());
scope.insert_var(arg.name, val);
}
self.scopes.exit_scope();

View File

@ -196,3 +196,20 @@ test!(
}"#,
"a {\n color: 'Roboto, \"Helvetica Neue\", sans-serif';\n}\n"
);
test!(
args_do_not_affect_existing_outer_variables,
"@mixin mixin2($a) {
color: $a;
}
@mixin mixin1($a) {
color: $a;
@include mixin2(bar);
color: $a;
}
a {
@include mixin1(foo);
}",
"a {\n color: foo;\n color: bar;\n color: foo;\n}\n"
);