File tree Expand file tree Collapse file tree 1 file changed +15
-15
lines changed
packages/svelte/src/compiler/phases/2-analyze Expand file tree Collapse file tree 1 file changed +15
-15
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments