Revert "check global scope for variable before local"

This reverts commit 27a9578b17a8ed8227cb190af38762111edae58f.

This ended up not being the desired behavior. It seems that instead of
checking the global scope first, variables declared with `!global` are
inserted into both the local and global scopes.
This commit is contained in:
ConnorSkees 2020-03-24 00:31:56 -04:00
parent 27a9578b17
commit 0979f3957b

View File

@ -56,12 +56,9 @@ impl Scope {
pub fn get_var(&self, v: &str) -> SassResult<Value> {
let name = &v.replace('_', "-");
match get_global_var(name) {
Ok(v) => Ok(v),
Err(e) => match self.vars.get(name) {
match self.vars.get(name) {
Some(v) => Ok(v.clone()),
None => Err(e)
}
None => get_global_var(name),
}
}