proper error message for non-string to feature-exists
@@ -22,7 +22,8 @@ pub(crate) fn register(f: &mut HashMap<String, Builtin>) {
"feature-exists".to_owned(),
Box::new(|args, _| {
max_args!(args, 1);
- match arg!(args, 0, "feature").unquote().to_string().as_str() {
+ match arg!(args, 0, "feature") {
+ Value::Ident(s, _) => match s.as_str() {
// A local variable will shadow a global variable unless
// `!global` is used.
"global-variable-shadowing" => Ok(Value::False),
@@ -39,6 +40,8 @@ pub(crate) fn register(f: &mut HashMap<String, Builtin>) {
// interpolation treated as SassScript.
"custom-property" => Ok(Value::False),
_ => Ok(Value::False),
+ },
+ v => Err(format!("$feature: {} is not a string.", v).into()),
}
}),
);
