error on empty name in `class:` directive (#5939)

pull/5958/head
Anders Lorentsen 4 years ago committed by GitHub
parent b3431f9bf2
commit acf60d88a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -387,6 +387,13 @@ function read_attribute(parser: Parser, unique_names: Set<string>) {
}, start);
}
if (type === 'Class' && directive_name === '') {
parser.error({
code: 'invalid-class-directive',
message: 'Class binding name cannot be empty'
}, start + colon_index + 1);
}
if (value[0]) {
if ((value as any[]).length > 1 || value[0].type === 'Text') {
parser.error({

@ -0,0 +1,10 @@
{
"code": "invalid-class-directive",
"message": "Class binding name cannot be empty",
"start": {
"line": 1,
"column": 10,
"character": 10
},
"pos": 10
}
Loading…
Cancel
Save