Skip to content

Commit e5ed5e0

Browse files
committed
remove else
1 parent 892351f commit e5ed5e0

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

packages/svelte/src/compiler/phases/2-analyze/validation.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -74,21 +74,21 @@ function validate_element(node, context) {
7474
if (attribute.name.startsWith('on') && attribute.name.length > 2) {
7575
if (!is_expression_attribute(attribute)) {
7676
error(attribute, 'invalid-event-attribute-value');
77-
} else {
78-
const value = attribute.value[0].expression;
79-
if (
80-
value.type === 'Identifier' &&
81-
value.name === attribute.name &&
82-
!context.state.scope.get(value.name)
83-
) {
84-
warn(
85-
context.state.analysis.warnings,
86-
attribute,
87-
context.path,
88-
'global-event-reference',
89-
attribute.name
90-
);
91-
}
77+
}
78+
79+
const value = attribute.value[0].expression;
80+
if (
81+
value.type === 'Identifier' &&
82+
value.name === attribute.name &&
83+
!context.state.scope.get(value.name)
84+
) {
85+
warn(
86+
context.state.analysis.warnings,
87+
attribute,
88+
context.path,
89+
'global-event-reference',
90+
attribute.name
91+
);
9292
}
9393
}
9494

0 commit comments

Comments
 (0)