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:
parent
27a9578b17
commit
0979f3957b
@ -56,12 +56,9 @@ impl Scope {
|
|||||||
|
|
||||||
pub fn get_var(&self, v: &str) -> SassResult<Value> {
|
pub fn get_var(&self, v: &str) -> SassResult<Value> {
|
||||||
let name = &v.replace('_', "-");
|
let name = &v.replace('_', "-");
|
||||||
match get_global_var(name) {
|
match self.vars.get(name) {
|
||||||
Ok(v) => Ok(v),
|
Some(v) => Ok(v.clone()),
|
||||||
Err(e) => match self.vars.get(name) {
|
None => get_global_var(name),
|
||||||
Some(v) => Ok(v.clone()),
|
|
||||||
None => Err(e)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user