From 0979f3957bd64ae87ae09d1cc515320bc8bf80b5 Mon Sep 17 00:00:00 2001 From: ConnorSkees <39542938+ConnorSkees@users.noreply.github.com> Date: Tue, 24 Mar 2020 00:31:56 -0400 Subject: [PATCH] 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. --- src/scope.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/scope.rs b/src/scope.rs index fbb5192..068b52a 100644 --- a/src/scope.rs +++ b/src/scope.rs @@ -56,12 +56,9 @@ impl Scope { pub fn get_var(&self, v: &str) -> SassResult { let name = &v.replace('_', "-"); - match get_global_var(name) { - Ok(v) => Ok(v), - Err(e) => match self.vars.get(name) { - Some(v) => Ok(v.clone()), - None => Err(e) - } + match self.vars.get(name) { + Some(v) => Ok(v.clone()), + None => get_global_var(name), } }