File tree 1 file changed +3
-5
lines changed
packages/runtime-core/src
1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ export type SchedulerCbs = SchedulerCb | SchedulerCb[]
30
30
let isFlushing = false
31
31
let isFlushPending = false
32
32
33
- const queue : ( SchedulerJob | null ) [ ] = [ ]
33
+ const queue : SchedulerJob [ ] = [ ]
34
34
let flushIndex = 0
35
35
36
36
const pendingPreFlushCbs : SchedulerCb [ ] = [ ]
@@ -87,7 +87,7 @@ function queueFlush() {
87
87
export function invalidateJob ( job : SchedulerJob ) {
88
88
const i = queue . indexOf ( job )
89
89
if ( i > - 1 ) {
90
- queue [ i ] = null
90
+ queue . splice ( i , 1 )
91
91
}
92
92
}
93
93
@@ -205,9 +205,7 @@ function flushJobs(seen?: CountMap) {
205
205
// priority number)
206
206
// 2. If a component is unmounted during a parent component's update,
207
207
// its update can be skipped.
208
- // Jobs can never be null before flush starts, since they are only invalidated
209
- // during execution of another flushed job.
210
- queue . sort ( ( a , b ) => getId ( a ! ) - getId ( b ! ) )
208
+ queue . sort ( ( a , b ) => getId ( a ) - getId ( b ) )
211
209
212
210
try {
213
211
for ( flushIndex = 0 ; flushIndex < queue . length ; flushIndex ++ ) {
You can’t perform that action at this time.
0 commit comments