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