File tree Expand file tree Collapse file tree 2 files changed +9
-7
lines changed
Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -119,12 +119,6 @@ export class ReactiveEffect<T = any>
119119 try {
120120 return this . fn ( )
121121 } finally {
122- if ( __DEV__ && activeSub !== this ) {
123- warn (
124- 'Active effect was not restored correctly - ' +
125- 'this is likely a Vue internal bug.' ,
126- )
127- }
128122 endTracking ( this , prevSub )
129123 const flags = this . flags
130124 if (
Original file line number Diff line number Diff line change 33import type { ComputedRefImpl as Computed } from './computed.js'
44import type { ReactiveEffect as Effect } from './effect.js'
55import type { EffectScope } from './effectScope.js'
6+ import { warn } from './warning.js'
67
78export interface ReactiveNode {
89 deps ?: Link
@@ -234,13 +235,20 @@ export function endTracking(
234235 sub : ReactiveNode ,
235236 prevSub : ReactiveNode | undefined ,
236237) : void {
238+ if ( __DEV__ && activeSub !== sub ) {
239+ warn (
240+ 'Active effect was not restored correctly - ' +
241+ 'this is likely a Vue internal bug.' ,
242+ )
243+ }
244+ activeSub = prevSub
245+
237246 const depsTail = sub . depsTail
238247 let toRemove = depsTail !== undefined ? depsTail . nextDep : sub . deps
239248 while ( toRemove !== undefined ) {
240249 toRemove = unlink ( toRemove , sub )
241250 }
242251 sub . flags &= ~ ReactiveFlags . RecursedCheck
243- activeSub = prevSub
244252}
245253
246254export function flush ( ) : void {
You can’t perform that action at this time.
0 commit comments