File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed
packages/svelte/src/compiler/phases/2-analyze Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -1071,18 +1071,18 @@ function is_safe_identifier(expression, scope) {
10711071 if ( node . type !== 'Identifier' ) return false ;
10721072
10731073 const binding = scope . get ( node . name ) ;
1074+ if ( ! binding ) return true ;
10741075
1075- if (
1076- binding &&
1077- ( binding . kind === 'prop' ||
1078- binding . kind === 'bindable_prop' ||
1079- binding . kind === 'rest_prop' ||
1080- binding . declaration_kind === 'import' )
1081- ) {
1082- return false ;
1076+ if ( binding . kind === 'store_sub' ) {
1077+ return is_safe_identifier ( { name : node . name . slice ( 1 ) , type : 'Identifier' } , scope ) ;
10831078 }
10841079
1085- return true ;
1080+ return (
1081+ binding . declaration_kind !== 'import' &&
1082+ binding . kind !== 'prop' &&
1083+ binding . kind !== 'bindable_prop' &&
1084+ binding . kind !== 'rest_prop'
1085+ ) ;
10861086}
10871087
10881088/** @type {import('./types').Visitors } */
You can’t perform that action at this time.
0 commit comments