remove else

pull/10442/head
Rich Harris 3 years ago
parent 892351fb54
commit e5ed5e0351

@ -74,21 +74,21 @@ function validate_element(node, context) {
if (attribute.name.startsWith('on') && attribute.name.length > 2) {
if (!is_expression_attribute(attribute)) {
error(attribute, 'invalid-event-attribute-value');
} else {
const value = attribute.value[0].expression;
if (
value.type === 'Identifier' &&
value.name === attribute.name &&
!context.state.scope.get(value.name)
) {
warn(
context.state.analysis.warnings,
attribute,
context.path,
'global-event-reference',
attribute.name
);
}
}
const value = attribute.value[0].expression;
if (
value.type === 'Identifier' &&
value.name === attribute.name &&
!context.state.scope.get(value.name)
) {
warn(
context.state.analysis.warnings,
attribute,
context.path,
'global-event-reference',
attribute.name
);
}
}

Loading…
Cancel
Save