File tree Expand file tree Collapse file tree 2 files changed +3
-6
lines changed Expand file tree Collapse file tree 2 files changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -274,10 +274,7 @@ function doWatch(
274274 let oldValue = isMultiSource ? [ ] : INITIAL_WATCHER_VALUE
275275 // overwrite default run
276276 watcher . run = ( ) => {
277- if (
278- ! watcher . active &&
279- ! ( flush === 'pre' && instance && instance . _isBeingDestroyed )
280- ) {
277+ if ( ! watcher . active ) {
281278 return
282279 }
283280 if ( cb ) {
Original file line number Diff line number Diff line change @@ -542,7 +542,7 @@ describe('api: watch', () => {
542542 expect ( cb ) . not . toHaveBeenCalled ( )
543543 } )
544544
545- it ( 'should fire on component unmount w/ flush: pre' , async ( ) => {
545+ it ( 'should not fire on component unmount w/ flush: pre' , async ( ) => {
546546 const toggle = ref ( true )
547547 const cb = vi . fn ( )
548548 const Comp = {
@@ -560,7 +560,7 @@ describe('api: watch', () => {
560560 expect ( cb ) . not . toHaveBeenCalled ( )
561561 toggle . value = false
562562 await nextTick ( )
563- expect ( cb ) . toHaveBeenCalledTimes ( 1 )
563+ expect ( cb ) . not . toHaveBeenCalled ( )
564564 } )
565565
566566 // vuejs/core#1763
You can’t perform that action at this time.
0 commit comments