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) {
1071
1071
if ( node . type !== 'Identifier' ) return false ;
1072
1072
1073
1073
const binding = scope . get ( node . name ) ;
1074
+ if ( ! binding ) return true ;
1074
1075
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 ) ;
1083
1078
}
1084
1079
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
+ ) ;
1086
1086
}
1087
1087
1088
1088
/** @type {import('./types').Visitors } */
You can’t perform that action at this time.
0 commit comments