@@ -1100,7 +1100,6 @@ function migrate_slot_usage(node, path, state) {
1100
1100
// if we stop the transform because the name is not correct we don't want to
1101
1101
// remove the let directive and they could come before the name
1102
1102
let removal_queue = [ ] ;
1103
- let slot_name_found = false ;
1104
1103
1105
1104
for ( let attribute of node . attributes ) {
1106
1105
if (
@@ -1130,7 +1129,6 @@ function migrate_slot_usage(node, path, state) {
1130
1129
}
1131
1130
}
1132
1131
}
1133
- slot_name_found = true ;
1134
1132
// flush the queue after we found the name
1135
1133
for ( let remove_let of removal_queue ) {
1136
1134
remove_let ( ) ;
@@ -1144,19 +1142,12 @@ function migrate_slot_usage(node, path, state) {
1144
1142
? `: ${ state . str . original . substring ( /** @type {number } */ ( attribute . expression . start ) , /** @type {number } */ ( attribute . expression . end ) ) } `
1145
1143
: '' )
1146
1144
) ;
1147
- function remove_let ( ) {
1148
- state . str . remove ( attribute . start , attribute . end ) ;
1149
- }
1150
- // if we didn't find the name yet we just add to the queue else we call immediately
1151
- if ( slot_name_found ) {
1152
- remove_let ( ) ;
1153
- } else {
1154
- removal_queue . push ( remove_let ) ;
1155
- }
1145
+ // we just add to the queue to remove them after we found if we need to migrate or we bail
1146
+ removal_queue . push ( ( ) => state . str . remove ( attribute . start , attribute . end ) ) ;
1156
1147
}
1157
1148
}
1158
1149
1159
- if ( ! slot_name_found && removal_queue . length > 0 ) {
1150
+ if ( removal_queue . length > 0 ) {
1160
1151
for ( let remove_let of removal_queue ) {
1161
1152
remove_let ( ) ;
1162
1153
}
0 commit comments