File tree Expand file tree Collapse file tree 3 files changed +7
-5
lines changed
Expand file tree Collapse file tree 3 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -594,7 +594,7 @@ describe('reactivity/computed', () => {
594594
595595 v . value += ' World'
596596 await nextTick ( )
597- expect ( serializeInner ( root ) ) . toBe ( 'Hello World World World World ' )
597+ expect ( serializeInner ( root ) ) . toBe ( 'Hello World World World' )
598598 // expect(COMPUTED_SIDE_EFFECT_WARN).toHaveBeenWarned()
599599 } )
600600
@@ -892,7 +892,7 @@ describe('reactivity/computed', () => {
892892 v . value += ' World'
893893 await nextTick ( )
894894 expect ( serializeInner ( root ) ) . toBe (
895- 'Hello World World World World | Hello World World World World' ,
895+ 'Hello World World World | Hello World World World' ,
896896 )
897897 } )
898898
@@ -962,7 +962,6 @@ describe('reactivity/computed', () => {
962962 } )
963963 } )
964964
965- // #11797
966965 test ( 'should prevent endless recursion in self-referencing computed getters' , async ( ) => {
967966 const Comp = defineComponent ( {
968967 data ( ) {
@@ -999,7 +998,7 @@ describe('reactivity/computed', () => {
999998 } )
1000999 const root = nodeOps . createElement ( 'div' )
10011000 render ( h ( Comp ) , root )
1002- expect ( serializeInner ( root ) ) . toBe ( `<button>Step</button><p>Step 1 </p>` )
1001+ expect ( serializeInner ( root ) ) . toBe ( `<button>Step</button><p></p>` )
10031002 triggerEvent ( root . children [ 1 ] as TestElement , 'click' )
10041003 await nextTick ( )
10051004 expect ( serializeInner ( root ) ) . toBe ( `<button>Step</button><p>Step 2</p>` )
Original file line number Diff line number Diff line change @@ -111,9 +111,9 @@ export class ComputedRefImpl<T = any> implements Subscriber {
111111 * @internal
112112 */
113113 notify ( ) : void {
114- this . flags |= EffectFlags . DIRTY
115114 // avoid infinite self recursion
116115 if ( activeSub !== this ) {
116+ this . flags |= EffectFlags . DIRTY
117117 this . dep . notify ( )
118118 } else if ( __DEV__ ) {
119119 // TODO warn
Original file line number Diff line number Diff line change @@ -345,6 +345,9 @@ function isDirty(sub: Subscriber): boolean {
345345 * @internal
346346 */
347347export function refreshComputed ( computed : ComputedRefImpl ) : false | undefined {
348+ if ( computed . flags & EffectFlags . RUNNING ) {
349+ return false
350+ }
348351 if (
349352 computed . flags & EffectFlags . TRACKING &&
350353 ! ( computed . flags & EffectFlags . DIRTY )
You can’t perform that action at this time.
0 commit comments