emitting get-function is an error

This commit is contained in:
ConnorSkees 2020-04-26 23:11:04 -04:00
parent a746d81013
commit 7db57054e1
2 changed files with 12 additions and 2 deletions

View File

@ -137,8 +137,13 @@ impl Value {
)
.into())
}
// TODO: should to_css_string on function fail?
Self::Function(func) => format!("get-function(\"{}\")", func.name()),
Self::Function(..) => {
return Err((
format!("{} isn't a valid CSS value.", self.inspect(span)?),
span,
)
.into())
}
Self::List(vals, sep, brackets) => match brackets {
Brackets::None => vals
.iter()

View File

@ -99,3 +99,8 @@ error!(
non_function_call,
"a {color: call(4);}", "Error: $function: 4 is not a function reference."
);
error!(
emit_plain_get_function_is_invalid_css,
"a {color: get-function(lighten);}",
"Error: get-function(\"lighten\") isn't a valid CSS value."
);