@@ -43,7 +43,6 @@ import { DeprecationTypes } from './compat/compatConfig'
4343import { checkCompatEnabled , isCompatEnabled } from './compat/compatConfig'
4444import { ObjectWatchOptionItem } from './componentOptions'
4545import { useSSRContext } from '@vue/runtime-core'
46- import { SSRContext } from '@vue/server-renderer'
4746
4847export type WatchEffect = ( onCleanup : OnCleanup ) => void
4948
@@ -297,7 +296,7 @@ function doWatch(
297296 ] )
298297 }
299298 if ( flush === 'sync' ) {
300- const ctx = useSSRContext ( ) as SSRContext
299+ const ctx = useSSRContext ( ) !
301300 ssrCleanup = ctx . __watcherHandles || ( ctx . __watcherHandles = [ ] )
302301 } else {
303302 return NOOP
@@ -318,9 +317,7 @@ function doWatch(
318317 deep ||
319318 forceTrigger ||
320319 ( isMultiSource
321- ? ( newValue as any [ ] ) . some ( ( v , i ) =>
322- hasChanged ( v , ( oldValue as any [ ] ) [ i ] )
323- )
320+ ? ( newValue as any [ ] ) . some ( ( v , i ) => hasChanged ( v , oldValue [ i ] ) )
324321 : hasChanged ( newValue , oldValue ) ) ||
325322 ( __COMPAT__ &&
326323 isArray ( newValue ) &&
@@ -461,7 +458,7 @@ export function traverse(value: unknown, seen?: Set<unknown>) {
461458 } )
462459 } else if ( isPlainObject ( value ) ) {
463460 for ( const key in value ) {
464- traverse ( ( value as any ) [ key ] , seen )
461+ traverse ( value [ key ] , seen )
465462 }
466463 }
467464 return value
0 commit comments